JNI
loadNativeCode native function MUST format as:
Static way:
JNIEXPORT void JNICALL Java_com_tapir_android_jniutils_test_MainActivity_emptyf(JNIEnv *env, jobject obj)
{
...
}
package name is com.tapir.android.jniutils.test
class name is MainActivity
function name is emptyf
Dynamic way,use RegisterNatives to register your native function in JNI_onLoad function
JNINativeMethod nm;
nm.name = "emptyf";
/* method descriptor assigned to signature field */
nm.signature = "()V";
nm.fnPtr = native_emptyf;
env->RegisterNatives( cls, &nm, 1);
native_emptyf MUST like as
void native_emptyf(JNIEnv *env, jobject obj)
{
...
}
hope can help u