diff options
author | Leith Bade <leith@mapbox.com> | 2015-07-31 13:00:52 +1000 |
---|---|---|
committer | Leith Bade <leith@mapbox.com> | 2015-08-11 11:59:08 +1000 |
commit | 0cbe7e07f5ada444de45b3936f7378dd4f3b9d6b (patch) | |
tree | 72e2e56f37659d9b55b2815ed9aa8a1e363c1184 /include | |
parent | dc11b8132ba7ccc58c280e580526425e7389df86 (diff) | |
download | qtlocation-mapboxgl-0cbe7e07f5ada444de45b3936f7378dd4f3b9d6b.tar.gz |
Use OkHTTP to implement HTTPContext on Android.
Closes #823
Diffstat (limited to 'include')
-rw-r--r-- | include/mbgl/android/jni.hpp | 29 |
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); + } } |