From Android source to apk--apk packaging process

Source: Internet
Author: User

How the Android program is changed from the source code to the APK that can be installed using

Original link http://sparkyuan.github.io/2016/04/01/from source to apk/, reprint please indicate source

Process official version

Detailed version

Above is a typical flowchart of the build process.

  • AAPT (Android Asset Packaging Tool) provides your activity with the required resource files, such as androidmanifest.xml,xml files, and compiles them. The R.java file is also generated so that you can reference these resources in Java code.
  • The Aidl tool converts the. Aidl interface into a Java interface.
  • All of your Java code, including R.java and. aidl files, is output. class files by the Java compiler and compiled.
  • The Dex tool converts. class files to Dalvik byte files, and third-party classes and. Class are also converted to. dex files
  • All resources that cannot be compiled (slices), compiled resource files, and. Dex are sent to the Apkbuilder tool to generate the final. apk
  • The. apk must be built with debug or release,release to provide the corresponding key
  • If you choose Release version, you also need to use the Zipalign tool to align the apk. The alignment means that all resource files are offset from the file starting at 4 bytes in integer multiples, which makes it faster to access the APK file through memory maps.
Output

Generated apk in the app/build/outputs/apk/directory, the naming rules app--. apk, for example, app-demo-debug.apk.

Original link http://sparkyuan.github.io/2016/04/01/from source to apk/, reprint please indicate source

From Android source to apk--apk packaging process

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.