The general process for a typical build is outlined below. The build system merges all the resources from the configured product flavors, build types, and dependencies. If different folders contain resources with the same name or setting, the following override priority order is: dependencies override build types, which override product flavors, which override the main source directory.
- The Android Asset Packaging Tool (aapt) takes your application resource files, such as the
AndroidManifest.xmlfile and the XML files for your Activities, and compiles them. AnR.javais also produced so you can reference your resources from your Java code. - The aidl tool converts any
.aidlinterfaces that you have into Java interfaces. - All of your Java code, including the
R.javaand.aidlfiles, are compiled by the Java compiler and .class files are output. - The dex tool converts the .class files to Dalvik byte code. Any 3rd party libraries and
.class files that you have included in your module build are also converted into
.dexfiles so that they can be packaged into the final.apkfile. - All non-compiled resources (such as images), compiled resources, and the .dex files are
sent to the apkbuilder tool to be packaged into an
.apkfile. - Once the
.apkis built, it must be signed with either a debug or release key before it can be installed to a device. - Finally, if the application is being signed in release mode, you must align the
.apkwith the zipalign tool. Aligning the final.apkdecreases memory usage when the application is -running on a device.

No comments:
Post a Comment