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.
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;
39 // do initialization required on android only
42 void cleanupAndroid();
45 * Initializes path_* variables for Android
46 * @param env Android JNI environment
48 void initializePathsAndroid();
51 * show text input dialog in java
52 * @param acceptButton text to display on accept button
53 * @param hint hint to show
54 * @param current initial value to display
55 * @param editType type of texfield
56 * (1==multiline text input; 2==single line text input; 3=password field)
58 void showInputDialog(const std::string &acceptButton,
59 const std::string &hint, const std::string ¤t, int editType);
61 void openURLAndroid(const std::string &url);
64 * WORKAROUND for not working callbacks from java -> c++
65 * get current state of input dialog
67 int getInputDialogState();
70 * WORKAROUND for not working callbacks from java -> c++
71 * get text in current input dialog
73 std::string getInputDialogValue();
76 float getDisplayDensity();
77 v2u32 getDisplaySize();