Read styles from APK

This commit is contained in:
Leith Bade
2014-11-17 23:17:22 +11:00
parent aee724d6cf
commit f0e4e27cd3
10 changed files with 130 additions and 128 deletions

View File

@@ -27,6 +27,7 @@ namespace android {
std::string cache_path;
std::string data_path;
std::string apk_path;
jmethodID on_map_changed_id = nullptr;
@@ -142,10 +143,11 @@ namespace {
using namespace mbgl::android;
jlong JNICALL nativeCreate(JNIEnv* env, jobject obj, jstring cache_path_, jstring data_path_) {
jlong JNICALL nativeCreate(JNIEnv* env, jobject obj, jstring cache_path_, jstring data_path_, jstring apk_path_) {
mbgl::Log::Debug(mbgl::Event::JNI, "nativeCreate");
cache_path = std_string_from_jstring(env, cache_path_);
data_path = std_string_from_jstring(env, data_path_);
apk_path = std_string_from_jstring(env, apk_path_);
NativeMapView* native_map_view = nullptr;
COFFEE_TRY_JNI(env, native_map_view = new NativeMapView(env, obj));
if (native_map_view == nullptr) {
@@ -787,7 +789,7 @@ extern "C" JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM *vm, void *reserved) {
// NOTE: if you get java.lang.UnsatisfiedLinkError you likely forgot to set the size of the array correctly (too large)
std::array<JNINativeMethod, 60> methods = {{ // Can remove the extra brace in C++14
{ "nativeCreate", "(Ljava/lang/String;Ljava/lang/String;)J", reinterpret_cast<void*>(&nativeCreate) },
{ "nativeCreate", "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)J", reinterpret_cast<void*>(&nativeCreate) },
{ "nativeDestroy", "(J)V", reinterpret_cast<void*>(&nativeDestroy) },
{ "nativeInitializeDisplay", "(J)V", reinterpret_cast<void*>(&nativeInitializeDisplay) },
{ "nativeTerminateDisplay", "(J)V", reinterpret_cast<void*>(&nativeTerminateDisplay) },