1, eclipse 新建android項目,添加jni目錄,配置ndk
android
2,jni目錄下新建第三方庫的引用源文件目錄,包含各個平臺的so包以及對應的頭文件eclipse
3,配置Android.mkide
第三方庫引用的配置文件如:ui
LOCAL_PATH := $(call my-dir)spa
include $(CLEAR_VARS)blog
LOCAL_MODULE := 引用庫別名ip
LOCAL_SRC_FILES :=$(TARGET_ARCH_ABI)/引用庫文件名稱.so get
include $(PREBUILT_SHARED_LIBRARY)it
主引用Android.mk文件內容:io
TOP_LOCAL_PATH :=$(call my-dir)
include $(call all-subdir-makefiles)
LOCAL_PATH := $(TOP_LOCAL_PATH)
include $(CLEAR_VARS)
LOCAL_MODULE:= 生成庫文件名稱
LOCAL_SHARED_LIBRARIES := \
引用庫別名
LOCAL_SRC_FILES :=\
XXXX.cpp\
XXXX.cpp
LOCAL_LDLIBS += -llog
include $(BUILD_SHARED_LIBRARY)
so庫編譯命令:
ndk-build APP_ABI="armeabi armeabi-v7a x86 mips"