Introduction

This article is an overview of how Android programs are compiled and executed. This explains what the build process of an Android application is. What are all the stages of its execution process?
Since the execution process of an Android application includes various terms like DEX, APK, dx tool, apt tool, javac and so on.. I will first try to cover various tools and terms that will be involved in compiling and building an Android application.
Difference between JVM and DVM
  1. JVM was designed for Java, by keeping Desktop applications in mind. The major difference between Desktop, and mobile is that mobiles have a very limited amount of memory (RAM) and less CPU speed compared to desktops and laptops. JVM is very heavyweight and requires a lot of RAM and CPU speed to execute a program. Since mobiles can't afford that much RAM and CPU, Android needs a more optimized and lightweight version of the JVM. The DVM was created to replace the JVM. The DVM is meant for embedded devices that have less RAM and CPU speed.
  2. One more major difference is that the JVM is not under a free license. Whereas the DVM is under a free license (Apache license).
  3. The JVM is slow because it is stack-based and the DVM is register-based.
  4. The DVM doesn't understand .class files, whereas JVM understands .class files.
  5. The DVM can only understand DEX files.
Android application Build process diagram
Android application Build process diagram
Check your Android interview skills.