To be comfortable with Android app development requires a deep understanding of how the Android project is compiled and packaged, such as knowing what it does every step of the way, what environment and tools are needed, what inputs and outputs are, and so on.
In the previous "command line Android app development" We already know how to create an Android project and compile an application that runs a debug version. This article describes the entire compilation process for Android engineering.
First, analyze how ant will package Android project compilation into an APK file.
Execution Ant Debug command when Ant Script Build.xml each Target graph of dependencies between
Execution Ant Debug command when Ant script each Target Execution Sequence Diagram
Android application build process Diagram
from the above illustrations, you can summarize Androd the build process for the app is roughly as follows:
1 , generating the R.java class file
2 , convert. aidl files to. Java class files
3 , compiling. Java class file generation class file
4 , package class file to generate Classes.dex file
5 , package resource files (including res, assets, A ndroid M Anifest.xml, etc.)
6 , Generate Debug mode-Signed APK file
7 , the a PK file for alignment