🔥 Android Studio 版本 🔥
🔥 创建包含JNI的类 JNIAccessMethod.java 🔥
package com.cmake.ndk1.jni; import com.cmake.ndk1.model.Animal; public class JNIAccessMethod { static { System.loadLibrary("access-method-lib"); } public native void accessInstanceMethod(Animal animal); public native void accessStaticMethod(Animal animal); }
🔥 Java方法对应JNI中方法名称 🔥
* |Java |JNI | * |String fun() |()Ljva/lang/String; | * |long f(int i,Class c); |(ILjava/lang/Class;)J | * |String(byte[] bytes); |([B)V