1.如何生成native对应的.h文件:
在src目录下执行如下命令 :
javah -classpath . -jni com.xx.RemoteHandService
如何引用第三方so文件:
第一步:新建目录,并将so与相关的.h文件拷贝进来,如下图:
第二步:添加Android.mk
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_SRC_FILES := libremotedesktop_client.so
LOCAL_EXPORT_C_INCLUDES := RemoteDesktop.h
LOCAL_MODULE := sansung_remotedesktop
include $(PREBUILT_SHARED_LIBRARY)
第三步:在要使用的地方引用sansung_remotedesktop
LOCAL_STATIC_LIBRARIES := sansung_remotedesktop
相关的C++文件include:
#include "../sansungremote/RemoteDesktop.h"