C++ (Cocos2d-x)

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.

iOS Integration

Download C++ SDK, and then follow the same step as Setup for iOS integration.

Android Integration

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:

LOCAL_SHARED_LIBRARIES+= libKTPlay

if LOCAL_SHARED_LIBRARIES not defined, then add the following:

LOCAL_SHARED_LIBRARIES:= libKTPlay 

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.

Step 4. Follow the Integration-Android for complete the integration

Have more questions? Submit a request

0 Comments

Please sign in to leave a comment.