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.