JNI is an interface that allows the execution of native code, written on C, C++, or Assembly, from the Java Virtual Machine (JVM). The interface strictly defines the way that any JNI implementation should act to manage and control the interactions between Java code and the machine code. Moreover, the machine code is able to interact with the JVM and create objects, execute member functions, modify the member variables and handle Java exceptions.
The JNI, which allows you to execute machine code along with your Java code, is typically used to:
Accelerate some critical portions of your application. Since the code runs directly on the hardware, it could make use of specific instruction sets to improve the execution:
Example: The use of SIMD instructions to accelerate audio or video floating-point operations.
Integrate existing C/C++ libraries in to your Android application. You can port any legacy code or library written to the Android platform and use it on your Android...