JNI jstring

JNIEXPORT jstring JNICALL Java_com_example_testjnipro_MainActivity_sayHello

 (JNIEnv * env, jobject thiz)

{

//return (*env)->NewStringUTF(env, "Hello from JNI !  Compiled with ABI ");

return env->NewStringUTF( "Hello from JNI !  Compiled with ABI ");

}

C++中用:

return env->NewStringUTF( "Hello from JNI !  Compiled with ABI ");

注意:只有一个参数!!


C中用:

return (*env)->NewStringUTF(env, "Hello from JNI !  Compiled with ABI ");

注意:有两个参数!!

你可能感兴趣的:(JNI jstring)