This section explains the configuration and initialization effort required for SDK integration of C++ (Cocos2d-x) game. After complete the efforts described in this section, please continue the integration effort for other function module.
Step 1. Setting Up JNI
Move KTPlaySDK/KTPlay/libs/armeabi to game's jin folder, tips, use "move" as to avoid duplicated .so during execution.
Copy all files from Include to game's jni folder.
Step 2. Setup Android.mk
In game's jni folder, open Android.mk file and append the following section:
include $(CLEAR_VARS) LOCAL_MODULE := libKTPlay LOCAL_SRC_FILES := libKTPlay.so LOCAL_MODULE_FILENAME := libKTPlay include $(PREBUILT_SHARED_LIBRARY)
if LOCAL_SHARED_LIBRARIES is defined, then add the following：
if LOCAL_SHARED_LIBRARIES not defined, then add the following：
Step 3. Load SDK shared library in your game
Before loading your game's shared libraries, call the following code to load SDK's shared library first.
System.loadLibrary("KTPlay"); //rest of your shared libraries loading code go here.