Android Ndk Basic: Help on the native line

To learn basic practical skills, I call a line to my application. I know this is too easy, but I am new to native languages. like

jstring Java_com_idiasoft_LoginActivity_NdkdealerName(JNIEnv* env, jobject javaThis) { return (*env)->NewStringUTF(env, "User Name"); } 

Here I can name this line in a specific class. But I want to make a dynamic call. like two or more classes. where i use the same string. How can i do this?

+4
source share
1 answer

Could not find the perfect solution for NDK, but I think that creating a global class in the Java part can help you in this situation. Just define this particular built-in function in your global class and use it anywhere. If you do not need to instantiate the class, you can also make it static and use it anywhere in the application. Hope this helps.

0
source

All Articles