OLD | NEW |
(Empty) | |
| 1 #include "simple.h" |
| 2 #include "simple/jni/MainActivity_jni.h" |
| 3 #include "base/android/jni_android.h" |
| 4 #include "base/android/base_jni_registrar.h" |
| 5 #include "base/android/base_jni_onload.h" |
| 6 #include "base/android/jni_onload_delegate.h" |
| 7 #include "base/memory/scoped_ptr.h" |
| 8 |
| 9 #include <vector> |
| 10 |
| 11 |
| 12 static jint GetValue(JNIEnv* env, jclass jcaller) { |
| 13 return simple::foo(); |
| 14 } |
| 15 |
| 16 // This is called by the VM when the shared library is first loaded. |
| 17 JNI_EXPORT jint JNI_OnLoad(JavaVM* vm, void* reserved) { |
| 18 scoped_ptr<std::vector<base::android::JNIOnLoadDelegate*>> delegates( |
| 19 new std::vector<base::android::JNIOnLoadDelegate*>()); |
| 20 if (!base::android::OnJNIOnLoad(vm, delegates.get())) |
| 21 return -1; |
| 22 JNIEnv* env = base::android::AttachCurrentThread(); |
| 23 base::android::RegisterJni(env); |
| 24 RegisterNativesImpl(env); |
| 25 return JNI_VERSION_1_4; |
| 26 } |
OLD | NEW |