package com.cmake.ndk1.jni; import com.cmake.ndk1.model.Animal; public class JNIConstructorClass { static { System.loadLibrary("constructor-class-lib"); } public native Animal invokeAnimalConstructors(); public native Animal allocObjectConstructor(); }
add_library( #动态库名称 constructor-class-lib constructor-class-lib SHARED jni/jni_constructor_class.cpp )
为了让Java能够调用 constructor-class-lib