The previous article introduces the use of JNI in Android using a simple example. This article is based on the understanding that some Java parameter types differ from the local parameter types.
1) The return value in Java is completely corresponding to void in JNI. (just one).
2) basic data types in Java (byte, short, int,long,float,double, boolean,char-8) The corresponding data type in JNI is prefixed with J corresponds to (jbyte, Jshort, Jint,jlong,jfloat,jdouble, Jboolean,jchar).
3) objects in Java, including classes, interfaces, and custom class interfaces defined in the class library, correspond to jobject in Jni .
4) The array of basic data types in Java corresponds to the j<type>array type in JNI. (type is the 8 basic data Types mentioned above)
5) An array of objects in Java corresponds to the jobjectarray type in JNI. ( all objects, interfaces, and arrays are objects in Java)
is a map of the Java data type and the JNI data type in the JNI specification.
The first map for the basic data type:
The second is a map of the reference data type:
/**
* @author Zhang Xingye
* Email: xy-zhang#163.com
* Android Development Advanced Group: 278401545
*
*/
Android JNI Introduction Second--java parameter types vs. local parameter types