| Index: apk/simple_jni.cc
|
| diff --git a/apk/simple_jni.cc b/apk/simple_jni.cc
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..0ca7fda89b3f1a55711db46b6a83cffd19245320
|
| --- /dev/null
|
| +++ b/apk/simple_jni.cc
|
| @@ -0,0 +1,26 @@
|
| +#include "simple.h"
|
| +#include "simple/jni/MainActivity_jni.h"
|
| +#include "base/android/jni_android.h"
|
| +#include "base/android/base_jni_registrar.h"
|
| +#include "base/android/base_jni_onload.h"
|
| +#include "base/android/jni_onload_delegate.h"
|
| +#include "base/memory/scoped_ptr.h"
|
| +
|
| +#include <vector>
|
| +
|
| +
|
| +static jint GetValue(JNIEnv* env, jclass jcaller) {
|
| + return simple::foo();
|
| +}
|
| +
|
| +// This is called by the VM when the shared library is first loaded.
|
| +JNI_EXPORT jint JNI_OnLoad(JavaVM* vm, void* reserved) {
|
| + scoped_ptr<std::vector<base::android::JNIOnLoadDelegate*>> delegates(
|
| + new std::vector<base::android::JNIOnLoadDelegate*>());
|
| + if (!base::android::OnJNIOnLoad(vm, delegates.get()))
|
| + return -1;
|
| + JNIEnv* env = base::android::AttachCurrentThread();
|
| + base::android::RegisterJni(env);
|
| + RegisterNativesImpl(env);
|
| + return JNI_VERSION_1_4;
|
| +}
|
|
|