Android.mk
LOCAL_STATIC_LIBRARIES: 表示该模块需要使用哪些静态库,以便在编译时进行链接。
LOCAL_SHARED_LIBRARIES: 表示模块在运行时要依赖的共享库(动态库),在链接时就需要,以便在生成文件时嵌入其相应的信息。
1. 使用java静态库:
(1) 定义
LOCAL_STATIC_JAVA_LIBRARIES := myTest
LOCAL_STATIC_JAVA_LIBRARIES += test2
(2) 预编译
include $(CLEAR_VARS) LOCAL_PREBUILT_STATIC_JAVA_LIBRARIES += myTest:/libs/test.jar LOCAL_PREBUILT_STATIC_JAVA_LIBRARIES += libs/test2.jar LOCAL_MODULE_TAGS := optional include $(BUILD_MULTI_PREBUILT)
2. 使用第三方so库
(1) 定义
LOCAL_JNI_SHARE_LIBRARIES += libSNPE
(2) 预编译
include $(CLEAR_VARS) LOCAL_PREBUILT_LIBS += libSNPE:/libs/armeabi-v7a/libSNPE.so (该so库会打包进apk中) LOCAL_MODULE_TAGS := optional include $(BUILD_MULTI_PREBUILT)
3. 使用模块编译的so库
LOCAL_REQUIRED_MODULES += libjni_filtershow_filters2