5. How to develop Android Applications
Android applications are primarily written within the Java programming language.
During development the developer creates the android specific configuration files and writes the application logic within the Java programming language.
The android development tooling converts these application files into an android application. If the developer trigger the deployment, the entire android application is compiled, packaged, deployed and probably started.
The android software Development Kit (Android SDK) and the Gradle tooling contains the required tools to create, compile and package android applications. The android team provides a Gradle plug-in to create android applications. you find the available versions of this plug-in beneath the subsequent URL: https://jcenter.bintray.com/com/android/tools/build/gradle/
The android SDK contains the android debug bridge (adb). adb is a tool that enables you to connect to a virtual or real android device, for the aim of managing the device or debugging your application.
5.1 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.