Android Application Package APK The internal structure of the detailed

Source: Internet
Author: User
Tags java se

The Android app will use a tool to convert all of the class files into a Dex file and then dalvik the virtual opportunity to read the instructions and data from them.

Android is Google's Linux platform based on the open source mobile phone operating system, each Android application at the bottom will be a separate Dalvik virtual machine instance, its code in the interpretation of the virtual machine to execute, the system released greatly facilitate the user's needs.

Each Android application runs in a Dalvik virtual machine instance, and each virtual machine instance is a separate process space. The threading mechanism of the virtual machine, memory allocation and management. mutexes, and so on, are all dependent on the underlying operating system. All Android applications have a thread that corresponds to a Linux thread, so that virtual machines can rely more on the operating system's thread scheduling and management mechanisms.

Different applications run in different process spaces, and applications from different sources run with different Linux users to maximize the security and independence of applications. Zygote is a virtual machine process and an incubator for a virtual machine instance, and whenever the system requires an Android application to execute, Zygote will fork a subprocess to execute the application.

The benefits of this are obvious: the zygote process is generated when the system is started, it completes the initialization of the virtual machine, the loading of the library, the loading and initialization of the preset class library, and so on, while the system needs a new instance of the virtual machine. Zygote provides the fastest system by replicating itself. In addition, for some read-only system libraries, all virtual machine instances share an area of memory with Zygote, which saves memory overhead.

After the application package (APK) is posted on the phone, the Dex file is optimized before running, and the optimized file is saved to the cache area (the optimized format is called Dey), and the virtual opportunity executes the file directly. If the application package file does not change, the Dey file is not regenerated.

The programming language used by Android applications is the Java language, like the Java SE, which is compiled using the Sun JDK to program Java source programs into standard Java bytecode files (. class files). All bytecode files are then converted to a Dex file (Classes.dex) via the tool software DX.

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.