1, install Cocos2d-x 2.2.3
Download Cocos2d-x 2.2.3 engine on cocos2d website, unzip after download
2. Install Eclipse and Android SDK
Eclipse is available on its website (website address).
Android SDK in Android Developer Center Download (address).
3. Installing the JDK
Eclipse requires a Java environment to run. If the Java environment is not installed beforehand, an error will be given.
Solution to install the JDK ().
4. Installing the CDT plugin ()
This is an Eclipse plug-in to support the development of the C + + language in Eclipse.
5. Install NDK ()
This is a necessary tool for mixed compilation of C + + and Java. Make a note of the directory that was extracted after the download, as it will be used in subsequent installations.
5. Import LIBCOCOS2DX
Open Eclipse, right-->import->existing Android Code into workspace->x:\cocos2d-x-2.2.3\cocos2d-x-2.2.3\cocos2dx\ Platform\android\java
6. Import Hellocpp
Open Eclipse, right-->import->existing Android Code into workspace->x:\cocos2d-x-2.2.3\cocos2d-x-2.2.3\samples\ Cpp\cocos2d-x-2.2.3\samples\cpp\hellocpp\proj.android
7. Modify C + + Build
Hellocpp Project Right-click->properties->c/c++ build->build command:x:\android-ndk-r9d-windows-x86_64\android-ndk-r9d \ndk-build.cmd
8. New Build
Right-click on hellocpp Item->properties->build->new->location:x:\android-ndk-r9d-windows-x86_64\android-ndk-r9d\ Ndk-build.cmd->working directory:${workspace_loc:/hellocpp}->enviroment variables to Set–>new->name: Ndk_module_path->value:x:\cocos2d-x-2.2.3;d:\game\cocos2d-x-2.2.3\cocos2d-x-2.2.3\cocos2dx\platform\third_ Party\android\prebuilt
9, modify the ANDROID.MK
Add to end of file:
$ (call Import-add-path, x:\cocos2d-x-2.2.3\cocos2d-x-2.2.3)
$ (call Import-add-path, x:\cocos2d-x-2.2.3\cocos2d-x-2.2.3\cocos2dx\platform\third_party\android\prebuilt)
$ (call import-module,cocosdenshion/android)
$ (call IMPORT-MODULE,COCOS2DX)
$ (call import-module,extensions)
10, modify the APPLICATION.MK
Add NDK path: ndk_module_path: = x:/cocos2d-x-2.2.3/cocos2d-x-2.2.3/cocos2dx/platform/third_party/android/prebuilt
11. Operation