1. Development Environment and software Ubuntu12.10 + JDK1.7AndroidSDKhttp: // response
1. Development Environment and software
Ubuntu 12.10 + JDK1.7
Android SDK http://developer.android.com/sdk/index.html
Android http://dl.google.com/android/ndk/android-ndk-r8e-linux-x86.tar.bz2
The Android SDK downloaded by Eclipse already comes with Eclipse.
Cocos2d-2.0-x-2.0.4 http://www.cocos2d-x.org/projects/cocos2d-x/wiki/Download
Decompress and download and configure the SDK.
2. Environment Configuration
Open the cocos2d-x root directory, edit the create-android-project.sh file, modify the NDK_ROOT_LOCAL and ANDROID_SDK_ROOT_LOCAL directories to the root directory of the NDK and SDK
NDK_ROOT_LOCAL = "/home/jiang/soft/android-ndk-r8e"
ANDROID_SDK_ROOT_LOCAL = "/home/jiang/soft/adt-bundle-linux-x86-20130219/sdk"
3. Create and run a cocos2d-x Project
3.1 generate a project
Run create-android-project.sh.
Enter the package path, target id, and project name to automatically generate the appropriate cocos2d-x project under the current directory.
$./Create-android-project.sh
Input package path. For example: org. cocos2dx. example
Com. rollcalf. example
Now cocos2d-x supports Android 2.2 or upper version
Available Android targets:
----------
Id: 1 or "android-15"
Name: Android 4.0.3
Type: Platform
API level: 15
Revision: 3
Skins: WVGA800 (default), HVGA, QVGA, WVGA854, WXGA720, WQVGA400, WQVGA432, WXGA800, WSVGA
ABIs: no ABIs.
----------
Id: 2 or "Google Inc.: Google APIs: 15"
Name: Google APIs
Type: Add-On
Vendor: Google Inc.
Revision: 2
Description: Android + Google APIs
Based on Android 4.0.3 (API level 15)
Libraries:
* Com. google. android. media. effects (effects. jar)
Collection of video effects
* Com. android. future. usb. accessory (usb. jar)
API for USB Accessories
* Com. google. android. maps (maps. jar)
API for Google Maps
Skins: WQVGA400, WVGA854, WSVGA, WXGA720, HVGA, WQVGA432, QVGA, WVGA800 (default), WXGA800
ABIs: armeabi-v7a
----------
Id: 3 or "android-17"
Name: Android 4.2.2
Type: Platform
API level: 17
Revision: 2
Skins: WVGA800 (default), HVGA, QVGA, WVGA854, WXGA720, WQVGA400, WQVGA432, WXGA800-7in, WXGA800, WSVGA
ABIs: armeabi-v7a
Input target id:
3
Input your project name:
Myexample