To use jni development, you need to include the jni.h header file
JNIEXPORT JNI : It is a keyword, not less (compilation can pass), marked as this method can be called externally
jstring: represents the string in java
JNICALL: It is also a keyword, which can reduce jni call
JNIENV: This is a bridge between c and java to call each other
jobject : the object passed by java
jclass : the class object passed by java
JNIEnv type declaration
#if defined(__cplusplus)
typedef _JNIEnv JNIEnv;
typedef _JavaVM JavaVM;
#else
typedef const struct JNINativeInterface* JNIEnv;
typedef const struct JNIInvokeInterface* JavaVM;
#endif
Look for the signature, the javap program in the bin directory of jdk
Access non-static properties in java in c/c++
Access static properties in java in c/c++
c/c++ accesses non-static methods in java
c/c++ accessing static methods in java is similar to obtaining non-static methods
Native builds java objects and returns them to the java layer