2013年9月3日 星期二

Cocos2d + Android NDK + Eclipse in Win32

Ref.
http://www.eoeandroid.com/thread-156516-1-1.html
http://www.eoeandroid.com/thread-93743-1-1.html
http://www.cocos2d-x.org/projects/cocos2d-x/wiki/How_to_run_test_cases_on_android-ndk

1.JDK 6
jdk-6u16-windows-i586.exe

2.Eclipse
eclipse-java-helios-SR2-win32.zip
http://www.eclipse.org/downloads/packages/release/helios/sr2

3.Android Sdk
http://developer.android.com/sdk/index.html
run installer_r16-windows.exe

4.ADT
Start Eclipse, then select Help > Install New Software....
https://dl-ssl.google.com/android/eclipse/
or
http://dl.google.com/android/ADT-16.0.1.zip
Start Eclipse, then select Help > Install New Software....
add Archive ADT-16.0.1.zip

5.Eclipse preferences
android preferences
SDK location: C:\Program Files\Android\android-sdk

6.Android sdk manager
enable follows:
Android sdk tools
Android sdk platform-tools
Android 2.1 API 7->sdk platform checked only
android support package
google usb driver package

7.AVD Manager
New a device
Android 2.1 API 7
512MB

////////////////////////////////////program setting////////////////////////////////////////////
1.Ndk 7
http://www.crystax.net/en/android/ndk/7

2.cygwin
http://www.cygwin.com/
switch Devel default to install

4.Set path in Control Panel
PATH = C:\android-ndk-r7-crystax-4

5.Add -DGL_GLEXT_PROTOTYPES=1 in C:\cocos2d-0.99.5-x-0.8.2\cocos2dx\Android.mk
LOCAL_CFLAGS := -DUSE_FILE32API -DGL_GLEXT_PROTOTYPES=1

6.modify C:\cocos2d-0.99.5-x-0.8.2\tests\test.android\build_native.sh
ANDROID_NDK_ROOT=/cygdrive/c/android-ndk-r7-crystax-4
COCOS2DX_ROOT=/cygdrive/c/cocos2d-0.99.5-x-0.8.2

7.Cygwin
cd /cygdrive/c/cocos2d-0.99.5-x-0.8.2/tests/test.android
./build_native.sh

8.eclipse
New Android Project
Create project from existing source
Location: C:\cocos2d-0.99.5-x-0.8.2\tests\test.android
Debug go

沒有留言:

張貼留言