3 Copyright (C) 2014 celeron55, Perttu Ahola <celeron55@gmail.com>
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU Lesser General Public License as published by
7 the Free Software Foundation; either version 2.1 of the License, or
8 (at your option) any later version.
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU Lesser General Public License for more details.
15 You should have received a copy of the GNU Lesser General Public License along
16 with this program; if not, write to the Free Software Foundation, Inc.,
17 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19 #ifndef __PORTING_ANDROID_H__
20 #define __PORTING_ANDROID_H__
23 #error this include has to be included on android port only!
27 #include <android_native_app_glue.h>
28 #include <android/log.h>
34 extern android_app *app_global;
36 /** java <-> c++ interaction interface **/
37 extern JNIEnv *jnienv;
40 * do initialization required on android only
43 void cleanupAndroid();
46 * set storage dir on external sdcard#
47 * @param lJNIEnv environment from android
49 void setExternalStorageDir(JNIEnv* lJNIEnv);
52 * use java function to copy media from assets to external storage
57 * show text input dialog in java
58 * @param acceptButton text to display on accept button
59 * @param hint hint to show
60 * @param current initial value to display
61 * @param editType type of texfield
62 * (1==multiline text input; 2==single line text input; 3=password field)
64 void showInputDialog(const std::string& acceptButton,
65 const std::string& hint, const std::string& current, int editType);
68 * WORKAROUND for not working callbacks from java -> c++
69 * get current state of input dialog
71 int getInputDialogState();
74 * WORKAROUND for not working callbacks from java -> c++
75 * get text in current input dialog
77 std::string getInputDialogValue();