March 2013
Intermediate to advanced
346 pages
8h 4m
English
JNI does little error checking for better performance.
As a result, errors usually lead to a crash. A mode called CheckJNI is offered by Android. In this mode, a set of JNI functions with extended checks are called instead of the normal JNI functions. This recipe discusses how to enable the CheckJNI mode to debug Android NDK applications.
The following steps create a sample Android project and enable the CheckJNI mode:
CheckJNIDemo. Set the package name as cookbook.chapter3. Create an activity named CheckJNIDemoActivity. Please refer to the Loading native libraries and registering native methods recipe of Chapter 2, Java Native Interface, if you ...