🔥 Android Studio 版本 🔥
🔥 创建包含JNI的类 JNIInvokeMethod.java 🔥
package com.cmake.ndk1.jni;
import com.cmake.ndk1.base.ICallbackMethod;
import com.cmake.ndk1.base.IThreadCallback;
public class JNIInvokeMethod {
static {
System.loadLibrary("invoke-method-lib");
}
public native void nativeCallback(ICallbackMethod callback);
public native void nativeThreadCallback(IThreadCallback callback);
}
🔥 配置动态库名称 🔥
add_library(
#动态库名称 invoke-method-lib
invoke-method-lib
SHARED
jni/jni_invoke_method.cpp
)
🔥 生成可关联的库链接 🔥
<