Move JNI bindings code from mapbox-gl-native to this repo. (#301)

This commit is contained in:
Igor Tarasov
2020-04-02 19:45:56 +03:00
committed by GitHub
parent 620bda356c
commit daecbed823
178 changed files with 14422 additions and 2 deletions

View File

@@ -0,0 +1,23 @@
#include "mapbox.hpp"
namespace mbgl {
namespace android {
jni::Local<jni::Object<AssetManager>> Mapbox::getAssetManager(jni::JNIEnv& env) {
static auto& javaClass = jni::Class<Mapbox>::Singleton(env);
auto method = javaClass.GetStaticMethod<jni::Object<AssetManager>()>(env, "getAssetManager");
return javaClass.Call(env, method);
}
jboolean Mapbox::hasInstance(jni::JNIEnv& env) {
static auto& javaClass = jni::Class<Mapbox>::Singleton(env);
auto method = javaClass.GetStaticMethod<jboolean()>(env, "hasInstance");
return javaClass.Call(env, method);
}
void Mapbox::registerNative(jni::JNIEnv& env) {
jni::Class<Mapbox>::Singleton(env);
}
} // namespace android
} // namespace mbgl