summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorLeith Bade <leith@mapbox.com>2015-08-12 14:58:33 +1000
committerLeith Bade <leith@mapbox.com>2015-08-12 14:58:33 +1000
commitd4159d51419ae59824c1a20cb682d2a66150a7ea (patch)
tree45a04302c1d11c9d7dec87d00de3406b65769b5e /include
parentc472717b604643cd2a2df0c45f04b2d55affe8ef (diff)
parent0cbe7e07f5ada444de45b3936f7378dd4f3b9d6b (diff)
downloadqtlocation-mapboxgl-d4159d51419ae59824c1a20cb682d2a66150a7ea.tar.gz
Merge branch 'android-okhttp'
Diffstat (limited to 'include')
-rw-r--r--include/mbgl/android/jni.hpp29
1 files changed, 29 insertions, 0 deletions
diff --git a/include/mbgl/android/jni.hpp b/include/mbgl/android/jni.hpp
index f27c8c8449..62cb399d3f 100644
--- a/include/mbgl/android/jni.hpp
+++ b/include/mbgl/android/jni.hpp
@@ -2,15 +2,27 @@
#define MBGL_ANDROID_JNI
#include <string>
+#include <vector>
// Forward definition of JNI types
typedef class _jclass* jclass;
+typedef class _jstring* jstring;
+typedef class _jobject* jobject;
+typedef class _jlongArray* jlongArray;
typedef struct _jmethodID* jmethodID;
typedef struct _jfieldID* jfieldID;
+struct _JavaVM;
+typedef _JavaVM JavaVM;
+
+struct _JNIEnv;
+typedef _JNIEnv JNIEnv;
+
namespace mbgl {
namespace android {
+extern JavaVM* theJVM;
+
extern std::string cachePath;
extern std::string dataPath;
extern std::string apkPath;
@@ -73,6 +85,23 @@ extern jmethodID pointFConstructorId;
extern jfieldID pointFXId;
extern jfieldID pointFYId;
+extern jclass httpContextClass;
+extern jmethodID httpContextGetInstanceId;
+extern jmethodID httpContextCreateRequestId;
+
+extern jclass httpRequestClass;
+extern jmethodID httpRequestStartId;
+extern jmethodID httpRequestCancelId;
+
+extern bool throw_jni_error(JNIEnv *env, const char *msg);
+extern bool attach_jni_thread(JavaVM* vm, JNIEnv** env, std::string threadName);
+extern void detach_jni_thread(JavaVM* vm, JNIEnv** env, bool detach);
+extern std::string std_string_from_jstring(JNIEnv *env, jstring jstr);
+extern jstring std_string_to_jstring(JNIEnv *env, std::string str);
+extern std::vector<std::string> std_vector_string_from_jobject(JNIEnv *env, jobject jlist);
+extern jobject std_vector_string_to_jobject(JNIEnv *env, std::vector<std::string> vector);
+extern jlongArray std_vector_uint_to_jobject(JNIEnv *env, std::vector<uint32_t> vector);
+
}
}