1. Use vs2010 to create a Win32 project of the cocos2d-x;
2. Run the cocos2d-x under the create-android-project.bat installation directory (requires cygwin support), input the android
Package name, project name, and SDK version level;
3. Resources under the resources directory can be copied to the android Assets Directory (cocos2d-x Samples
In addition to configuring the ndk compilation information, you must copy the resources before packaging );
4. Replace the files under the Win32 classes directory with the files under the android project classes directory (ndk compilation files );
5. Copy resources in your Win32 project to the current resources (delete the redundant resources in the classes, that is, those automatically generated by the project)
6. Edit MK,
#1. Be careful! There are a lot of mk in the Android project, and the MK positions are different in different tutorials! An error occurred while editing. It is invalid. In the new engine version, Android. mk is under the JNI directory.
#2 modify the following content:
Local_src_files: add the CPP file under your classes.
Local_c_includes: add the H file of the library you are using here, if any
Local_ldlibs: add the Lib file of the library you are using here, if any
Note that third-party libraries and additional libraries must be added by yourself. The default generated MK is not that full.
7. Create an android project in eclipse. Use
Create project from existing source, which may not be identified if you are using "import.
8. Configure builder again (some configurations are described earlier );
9. Compile and run the builder project of the eclipse project;
Process extended classes from Win32 project porting to Android:
How to Use the box2d engine for coocs2d-x2.0.3x on Android:
Open the <project> \ proj. Android \ JNI \ Android. mk file,
Set local_whole_static_libraries: = cocos2dx_static cocosdenshion_static
Change to local_whole_static_libraries: = cocos2dx_static cocosdenshion_static box2d_static;
Add a sentence $ (call import-module, external/box2d)