Cocos2dx setup Eclipse environment for Android
Notes for porting cocos2dx games from iOS to Android:
- create-android-project.sh
- eclipse > new project from existing code
- add NDK_ROOT variable in eclipse (build_native.sh need to define NDK_ROOT, otherwise will report "Please define NDK_ROOT")
NDK_ROOT "path.to/android-ndk-r8b"
- make eclipse able to compile c++
New > Others > Convert to c/c++ project
- setup build path
bash path.to/build_native.sh NDK_DEBUG=1 V=1
- add include path: C++ General > Path and symbols
$(COCOS2DX_HOME)/cocos2dx
$(COCOS2DX_HOME)/cocos2dx/include
$(NDKROOT)/platforms/android-9/arch-arm/usr/include
$(workspace_loc)/Classes
- add c++ classes
link from source
- Build all (this will build the c++ library)
- Run As (this will pack the apk using jni)
Note:
- create AVD > enable GPU emulation for OpenGL ES2.0 support (start from Android 4.03)
- upon test I'm still not able to run OpenGL ES2.0 in emulator, but deploy to real device will work
更多相关文章
- 代码中设置drawableleft
- android 3.0 隐藏 系统标题栏
- Android开发中activity切换动画的实现
- Android(安卓)学习 笔记_05. 文件下载
- Android中直播视频技术探究之—摄像头Camera视频源数据采集解析
- 技术博客汇总
- android 2.3 wifi (一)
- AndRoid Notification的清空和修改
- Android中的Chronometer