Issue
I follow this guide, Hello-JNI https://codelabs.developers.google.com/codelabs/android-studio-jni
From internet sources, I found that the guide/sample//example/tutorial only provide the following example JNI function which is String :
JNIEXPORT jstring JNICALL
Java_com_example_test_helloandroidjni_MainActivity_getMsgFromJni(JNIEnv *env, jobject instance) {
return (*env)->NewStringUTF(env, "Hello From Nani 2");//5. change return name
}
Above is the implementation, and its declaration is :
public native String getMsgFromJni();
I found there are another example instead of String but that program is for run in PC, not in Android.
I spent many hours but could not found any JNI function except String. I want JNI function for int, void, etc too.
Solution
Please refer this following link :
http://www3.ntu.edu.sg/home/ehchua/programming/java/JavaNativeInterface.html
Answered By - Saritha G
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.