August 2016
Intermediate to advanced
412 pages
9h 3m
English
JNI stands for Java Native Interface. JNI allows libraries and software written in other languages to access the Java code that is running in the Java Virtual Machine (JVM). This is not something Android-related, but a programming framework that has existed and been used previously in the Java world.
JNI needs files to be declared into either C or C++—it can even connect to Objective-C files. This is what an example in C looks like:
jstring
Java_com_my_package_HelloJni_stringFromJNI( JNIEnv* env,
jobject thiz )
{
return (*env)->NewStringUTF(env, "Hello World");
}Observing the file, we can see that after the return type, jstring, which is equivalent to a string, there is structure with the word Java, the package name, the class name, and the ...
Read now
Unlock full access