Adding android to an existing project

Adding android to an existing project
0.0 0


How can I do this?

I’m trying to build the TweeJump Cocos2d-x code for iPhone and Android, I need to know how to add the android directory to the source code and then build for android using it.

Thank you



May be you should know how an android project is built.
You can refer the HelloWorld example or the ndk example.

Following are some steps:

  1. use create-android-project.bat(under windows) or linux or mac os) to create an android project
  2. copy TweeJump code(the .cpp and .h file) into PROJECT_ROOT/classes
  3. modify the PROJECT_ROOT/android/jni/helloworld/ to compile the TweeJump code


Usually, I create an empty cocos2d-x android project by the script, then add the existing files to it :slight_smile: