Android porting process with cocos2d-x3.1.1

Source: Internet
Author: User

Android porting process with cocos2d-x3.1.1

Evernote link:




Cocos2d-x 3.1.1 win porting to android Win: vs2012 Android: eclipse and ndk-91. For vs2012 projects, the cpp and. h In the proj. win32 folder are the image sounds in the Classes folder.
2. Step 1: import the eclipse path ***** + SecondGame2proj. android

3. Step 2: Change android. mk in jni to modify the compilation file and add the new cpp file. Note that main. cpp does not need to be added because this main is win32 main. android has its own portal activity.

At this time, run application appears:

4. in step 3, right-click the environment variable for ndk compilation and choose Project> property> c/c ++ build> environment> add

5. In Step 4, right-click a position and right-click the folder pointed by the Arrow below to enter the property
Enter property
PATH is: G: microsoftcocos2dcocos2d-x-3.1.1cocosplatformandroidjavasrc [remember to modify your path prefix]
[Note] android: screenOrientation = Portrait

6. run application:
The modified cpp file has been used by jni of androd before. Compile cpp, that is, c ++ code, into an so file using ndk, and call it for the java layer like a library.
Cpp file of the engine
Later compilation takes a long time in the cpp Compilation part of this engine
Warning during compilation:
7. win32:
Android DDMS




Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.