Android – Build Process

Android Application is made up of various components. These components are implemented using Java classes. For example, controls such as TextView, EditText, Button used in the Android application are all instances of Java classes.

the application written in Java needs to be converted in a format which is device friendly. Android device understands file format as APK.Android APK i.e Android Package Kit is the file format used by the Android operating system for distribution and installation of mobile apps on various devices.

The Android compilation system compiles app resources and source code, dependencies and generates bytecode, with PROGUARD, the code is optimized. This optimized code is again compiled and DEX bytecode is generated, finally, compilation system packages into APK file format that you can use for testing and distributing.

Build process is automated and managed using advanced build toolkit called as Gradle. Gradle allows to define customizable build configurations. Along with common build resources, every build can be configured using code and resources.

Build Process

Actual build process involves many resources which can be processed to generate/build Android APK.

Android Build Process

Steps in Build process

  1. The compilers converts  ource code into DEX (Dalvik Executable) files, which include the bytecode that runs on Android devices, and everything else into compiled resources.
  2. The APK Packager combines the DEX files and compiled resources into a single APK.
  3. The APK Packager signs your APK using either the debug or release keystore:
    1. If you are building a debug version of your app, that is, an app you intend only for testing and profiling, the packager signs your app with the debug keystore. Android Studio automatically configures new projects with a debug keystore, user doesn’t have to generate keystore explicitly.
    2. If you are building a release version of your app that you intend to release externally, the packager signs your app with the release keystore.
    3. Before generating your final APK, the packager uses tool to optimize your app to use less memory when running on a device.

Build process will give debug APK or release Apk. These APK can be used to deploy, test,release to users.

Difference between Debug APK and Release APK –

  • In case of Debug APK, debug flag will be enabled and build will be generated using default signing keys
  • For release APK keys user will be generating the keys to sign with. The debug flag will be turned off so that it cannot be debugged.
  • Proguard can be turned on for release builds. This step needs to be done explicitly and is false by default. Proguard is used to delete unused code, this is done to optimize the code.

We will add details of configuration file in new article.

For our expertise and help in app development services, please get in touch with http://purplechai.com/


Leave a Reply

Your email address will not be published. Required fields are marked *