[Audio and video Android development (11)] jni basics

  1. To use jni development, you need to include the jni.h header file

  1. JNIEXPORT JNI : It is a keyword, not less (compilation can pass), marked as this method can be called externally

  1. jstring: represents the string in java

  1. JNICALL: It is also a keyword, which can reduce jni call

  1. JNIENV: This is a bridge between c and java to call each other

  1. jobject : the object passed by java

  1. jclass : the class object passed by java

  1. JNIEnv type declaration

#if defined(__cplusplus)
typedef _JNIEnv JNIEnv;
typedef _JavaVM JavaVM;
#else
typedef const struct JNINativeInterface* JNIEnv;
typedef const struct JNIInvokeInterface* JavaVM;
#endif
  1. Look for the signature, the javap program in the bin directory of jdk

  1. Access non-static properties in java in c/c++

  1. Access static properties in java in c/c++

  1. c/c++ accesses non-static methods in java

  1. c/c++ accessing static methods in java is similar to obtaining non-static methods

  1. Native builds java objects and returns them to the java layer

Guess you like

Origin blog.csdn.net/qq_40179458/article/details/129309366