About the version of Android, android

Source: Internet
Author: User

About the version of Android, android

Although I often deal with android, I don't know much about android. Here we record the process of ant compiling the android project, and then record some basic concepts of android by the way. If you do not want to cross the ship, but you want to cross the ship. Here is just a record of the process of practice, refer to the blog connection click here.

The process is as follows:

1> Generate the R. java file. (Note: This file is an index file for android resources)

2> compile the java code into a class file.

3> Generate the class. dex file from the jar package and class file. (Note: class is a java binary file. The jar package is a packaged class file and can be directly run using the jar command. Dex is the executable file format on android. Note that apk is only a compressed package. After installation, it is automatically decompressed and the dex file is executed)

4> package and compress the assets and res files. (Note: Do cocos2d-x should be familiar with this, the resources used by the game are finally hit to the assets file through the build script, the resources here will not be retrieved in the R file, res can be retrieved through the R file. The specific reason is unclear. After all, java code can be used for reading ).

5> package dex files and resource files into apk files.

6> sign the apk. (The path for storing the personal signature file in mac is :~ /. Android/debug. keystore)

A build. xml file is used for compilation. If this file is not found in your project directory, it can be generated through android update project -- path. (Note: $ {} retrieves the path in {}) (Note: aapt is the Android Asset Packaging Tool. You can view, create, and update ZIP file attachments, you can also compile the resource file into binary (Note: apkbuilder is discarded after android3.0, character encoding ).

Running ant debug directly may cause the following error: sdk. dir is missing. make sure generate local. properties using ..., the reason is unclear. The local file has been generated. properties, but the system prompts that it cannot be found, but can be passed in manually. The input method is-Dsdk. dir = {sdk path }. This may cause problems. The error prompt is: build. xml: 601: The following error occurred while executing this line. What you need to do is to turn off eclipse, run ant clean, and then re-run ant debug.

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.