"Diablo World" Android APK compilation process detailed instructions Tutorial!

Source: Internet
Author: User

Original address: http://bbs.gameres.com/forum.php?mod=viewthread&tid=223671

About the development of the environment, the relevant documents have been described in detail, the construction of the environment please refer to the previous relevant documents, if there is a problem, in a timely manner in the Forum to ask questions, there will be a quick answer to the management, this document is mainly for eclipse under the Android compiler.
First of all, it must be the source of the Dark World into eclipse, the source code into the import, began to compile the preparation work, here first need to classes inside of the. cpp file and the associated folder path in, open the project of the Dark World under Eclipse, open the Jni folder, Locate android.mk this file, and double-click it to open it.

<ignore_js_op>

Open and then write the names of all the. cpp files in sequence, as shown in part of the. cpp file.

<ignore_js_op>

Of course so. cpp files are all manually filled in and can be cumbersome, where a shell script is used to automatically generate all of the. cpp file listings, which are included in the script's attachment (list.sh). How do I use this script? Open the terminal and enter the following command in turn

  1. CD $COCOS 2dx_root//Enter the root directory of the Cocos2d-x
  2. LS//List all directories and find projects
  3. CD projects//Enter the projects directory
  4. LS//Find the source of the Dark World, enter the Proj.android directory
  5. CD Tsdemo//...
  6. LS//...
  7. CD proj.android//...
  8. LS//...
  9. CD JNI//...
  10. LS//Enter this directory and you will see a list.sh file in the list
  11. ./list.sh. /.. /classes//Use list.sh to List Classes. ccp file List
Copy Code



<ignore_js_op>

Copy the generated. CPP list and paste it into the corresponding location inside the android.mk.

The next step is to add some of the files in the classes, as shown in the specific add-on location.

<ignore_js_op>

When adding a folder path, please note that this is to find classes code, so the path here can not write the full path, but in the IDE, such as Xcode, you must add the default path.
All right, get ready, start compiling the code, right-click on the project, Run as->android application, start compiling, but you may be able to report the can ' t find NDK at this point. Please define NDK, if this error occurs, then manually add the NDK into the project, Project->properties->c/c++ Build->environment, in the right area, click Add, Press the name as Ndk_root, and then write your own NDK path in value.

<ignore_js_op>

Problems are solved, and now start compiling the source code, the whole process will take a while (if the compilation process has other problems, be sure to remember to the forum post, there will be relevant personnel to reply in time), after the compilation is completed, in the project Bin directory will see the generated. APK installation package, if you want to see the effect after compiling, or direct access to the real machine as well, Android comes with the simulator speed is really not flattering.
Run->run configurations->android Application->tsdemo, select Target on the right, select Always prompt to pick device, so that after the real machine, Each run will automatically identify your device to install.

<ignore_js_op>

2013-9-23 10:38:34 upload Download attachment(76.89 KB)



    Run after the program appears to be horizontal screen, you have to manually modify the Android configuration file, found in the bin directory Androidmanifest.xml, opened, see there are many items, Specific each item is what meaning, many online, here do not do too much explanation, find this android:screenoriention, change inside value is portrait can run the program normally. The
in the Res directory under the values directory has a strings.xml file, open after the version can be set up, after the name of the string tag will be installed on the device to modify the names of the APK, in this directory there are several other folders, As you can see from the name of the folder, they are prepared for the icon to place the APK with different resolutions.
Finally, if you have a problem, you must remember to post to the forum Oh!

list.sh in the attachment "copper-free" Download!

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: info-contact@alibabacloud.com 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.