peterhpchen
5/16/2014 - 3:58 AM

Android NDK test

Android NDK test

public native String getStringFromNative();
/* DO NOT EDIT THIS FILE - it is machine generated */
#include "com_hpchen_testndk_app_MainActivity.h"
/* Header for class com_hpchen_testndk_app_MainActivity */

/*
 * Class:     com_hpchen_testndk_app_MainActivity
 * Method:    getStringFromNative
 * Signature: ()Ljava/lang/String;
 */
JNIEXPORT jstring JNICALL Java_com_hpchen_testndk_app_MainActivity_getStringFromNative
  (JNIEnv *env, jobject obj) { return (*env)->NewStringUTF(env, "Hello JNI !");}
static {
  System.loadLibrary("MyLib");
}
javah -d jni -classpath {sdk_dir}\platforms\android-19\android.jar;..\..\build\classes\debug com.hpchen.testndk.app.MainActivity
ndk {
  moduleName "MyLib"
}
ndk.dir=C\:/Android/android-ndk-r9d