5. Conversion process from source code to Android application
The Java source files are converted to Java class files with the Java compiler. The android SDK contains a tool known as dx that converts Java class files into a .dex (Dalvik Executable) file. All class files of the application are placed in this .dex file. throughout this conversion process redundant information within the class files are optimized within the .dex file. as an example, if an equivalent String is found in numerous class files, the .dex file contains only one reference of this String.
These .dex files are therefore much smaller in size than the corresponding class files.
The .dex file & the resources of an android project, e.g., the images and XML files, are packed into an .apk (Android Package) file. The program aapt (Android quality Packaging Tool) performs this step.
The ensuing .apk file contains all necessary information to run the android application and can be deployed to an android device via the adb tool.
As of android 5.0 the android RunTime (ART) is employed as runtime for all android applications. ART uses prior Time compilation. throughout the installation of an application on an android device, the application code is translated into machine language. This leads to approx. half-hour larger compile code, however permits quicker execution at startup.
This conjointly saves battery life, because the compilation is barely done once, throughout the first start of the application.
The dex2oat tool takes the .dex file created by the android tool change & then compiles that into an executable and Linkable Format (ELF file). This particular file contains the dex code, compiled native code & the meta-data. Keeping the .dex code permits that existing tools still work.
The garbage assortment in ART has been optimized to scale back times within which the application freezes.