2017-04-25 8 views

Répondre

0

Vous avez besoin d'un fichier Android.mk dans votre dossier app/src/main/jni. Il devrait ressembler à ceci

LOCAL_PATH := $(call my-dir) 

# This block is to make the NDK aware of your static library 
include $(CLEAR_VARS) 
LOCAL_MODULE := libconfig 
LOCAL_SRC_FILES := path/to/libconfig/libconfig.a 
include $(PREBUILT_STATIC_LIBRARY) 

# This block is to build your C++ code that will call the method in the static library 
include $(CLEAR_VARS) 
LOCAL_MODULE := ThatWillCallTheMethod 
LOCAL_SRC_FILES := cppFileThatWillCallTheMethod.cpp 
LOCAL_STATIC_LIBRARIES := libconfig.a 
include $(BUILD_SHARED_LIBRARY) 

Dans votre dossier jni, vous aurez: cppFileThatWillCallTheMethod.cpp. Et dans ce fichier, vous appelerez CLIENT_ConfigIPCWifi (szDeviceSN, szSSID, szSSIDPassword, nWaitTime); D'une manière ou d'une autre, vous devrez connaître les fichiers d'en-tête de libconfig.a que vous devez inclure.

Espérons que cela aide!