FROM: http://developer.android.com/guide/developing/building/index.html#detailed-build

Building and Running

The following diagram depicts the components involved in building and running an application:


 

12595C394F386B4C189450  

 


A Detailed Look at the Build Process

 

110545464F3886303136A2  

 

 

 

 

 

 

The general process for a typical build is outlined below:

  • The Android Asset Packaging Tool (aapt) takes your application resource files, such as the AndroidManifest.xml file and the XML files for your Activities, and compiles them. An R.java is also produced so you can reference your resources from your Java code.
  • The aidl tool converts any .aidl interfaces that you have into Java interfaces.
  • All of your Java code, including the R.java and .aidl files, 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 project are also converted into .dex files so that they can be packaged into the final .apk file.
  • All non-compiled resources (such as images), compiled resources, and the .dex files are sent to the apkbuilder tool to be packaged into an .apk file.
  • Once the .apk is 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 .apk with the zipalign tool. Aligning the final .apkdecreases memory usage when the application is running on a device. 
arrow
arrow
    全站熱搜

    戮克 發表在 痞客邦 留言(0) 人氣()