How and what converts the Java bytecode to Android dex files?

百般思念 提交于 2020-01-02 05:45:08

问题


How and what exactly converts the java byte-code to dex file in Android ?

I know that the only part Android people have done to save them from licensing issues, making the system fast for execution, low memory need and other more features as it is register based VM.

But what name I can tell to the part it doing so?


回答1:


Go through bellow url and read all details Detail URL

The general process for a typical build is outlined below:

  1. 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.

  2. The aidl tool converts any .aidl interfaces that you have into Java interfaces.

  3. All of your Java code, including the R.java and .aidl files, are compiled by the Java compiler and .class files are output.

  4. 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.

  5. 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.

  6. Once the .apk is built, it must be signed with either a debug or release key before it can be installed to a device.
  7. Finally, if the application is being signed in release mode, you must align the .apk with the zipalign tool. Aligning the final .apk decreases memory usage when the application is running on a device.




回答2:


There is a link to explain the compilation of Java, Java bytecode, and into Dex bytecode.

  • http://lazyswamp.blogspot.kr/2013/08/this-is-post-to-help-to-understand-how.html
  • http://lazyswamp.blogspot.kr/2013/08/java-java-bytecode-and-dalvik-bytecode-2.html


来源:https://stackoverflow.com/questions/24570534/how-and-what-converts-the-java-bytecode-to-android-dex-files

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!