How to create a new Android project

Hello all,

I’m a newbie in Cocos2d-x. I read instruction to build samples and did successfully. However, I want to create my own project which can be able to run on Android. Can you give me a detail tutorial such as how to create project, how to implement classes, resources, etc.

In addition,I’m developing in Windows 7, and I can’t setup X-Code like this tutorial. Are there any other solutions?
[[http://www.raywenderlich.com/33752/cocos2d-x-tutorial-for-ios-and-android-space-game]]

Thank you so much

You can run this script https://github.com/cocos2d/cocos2d-x/blob/develop/tools/project-creator/create_project.py
It’s in your cocos2d-x/tools/project-creator/create_project.py
Type ./create_project.py enter, then this script will print help for you.

I did, but how I can implement resource such as images, sound, font, etc with Eclipse?
Moreover, I also want to create my own class in Eclipse but it’s unable.
My main question is “Can I develop directly in Eclipse for Android?”

Hello Zhe Wang,

I downloaded cocos2dx 2.2.1 and there is already create_project.py. I just want to let you know that i use python 3 so the print “blabla” statement gave me errors.

After i changed it to print(“blabla”), now it gives me an error :
Traceback (most recent call last):
File “create_project_fixed.py”, line 195, in
processPlatformProjects(platform)
File “create_project_fixed.py”, line 161, in processPlatformProjects
replaceString(proj_path + dst, context[“src_package_name”], context[“dst_pac
kage_name”])
File “create_project_fixed.py”, line 111, in replaceString
if src_string in line:
TypeError: Type str doesn’t support the buffer API

should i change the script into the one in github?
i noticed there are also differences in json files. which one should i use? the github one or the one from 2.2.1?