主要开发调用流程如下:
首先:在src/main/ 目录下新建一个jni文件夹
src/main/jni
第二步:
在jni文件里面添加一个Android.mk文件以及第三方so库及其头文件
第三步:
编写Android.mk
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := T613_I2C_DLL
LOCAL_SRC_FILES := Source/SharedLibs/$(TARGET_ARCH_ABI)/libT613_I2C_DLL.so
include $(PREBUILT_SHARED_LIBRARY)
include $(CLEAR_VARS)
LOCAL_MODULE := SerialPort
LOCAL_SRC_FILES := Source/SharedLibs/$(TARGET_ARCH_ABI)/libSerialPort.so
include $(PREBUILT_SHARED_LIBRARY)
include $(CLEAR_VARS)
LOCAL_C_INCLUDES += $(LOCAL_PATH)/Source/include
LOCAL_MODULE := T613_FPC
LOCAL_SRC_FILES := JNI.cpp
LOCAL_SHARED_LIBRARIES := T613_I2C_DLL SerialPort
include $(BUILD_SHARED_LIBRARY)
第四步:
配置一下app目录下的build.gradle文件。