So let's look at some of the details of Android runtime and the compilation process of an epic with
a lifecycle diagram.
Android apps are usually written in Java and compiled to Dalvik bytecode, which is somewhat different
from the traditional Java bytecode.
Dalvik bytecode is created by first compiling the Java code to class files and converting the JVM byte
code to the Dalvik decs.
Format with index tool.
Dex, LPT does some optimizations on the text file and the result of Dex LPT is an oh Dex or optimized
dex file.
Then it's packaged into RPK files with a B.K. builder.
So let's have a look at that, because RPK, it stands for Android Package Kit and also Android application
package.
So it's a file format that Android uses to distribute and install apps, it contains all of the elements
that an app needs to install correctly on your device.
So just like files on windows, you can place in APK file on your Android device to install an app.
Oh, Dex files and Dex files were executed by Dalvik.
Dalvik also uses Just in Time compilation, which was introduced in Android 2.0 to Froyo.
Just in time, compilation adversely affects performance because compilation must be performed every
time the app is executed.
Now to improve performance since Android 5.0 Lollipop.
Android executes this by code on the Android runtime or A.R.T..
The Android system uses a tool called Decs to 08, which converts decs files into LTH files, which
can be executed natively.
So instead of having bytecode that is interpreted by a virtual machine and now has native code that
will be executed natively by the processor.
So this is called ahead of time or a Iot compilation.
Now, as the name would imply, apps are pre compiled before they're executed for the very first time.
This decompiled machine code is used for all subsequent executions.
A improves performance by a factor of two while reducing power consumption.
Art increases battery performance to such a large extent because of the AOT.
So while Dalvik uses the Gitti or Gite approach, it results in much more battery utilization.
So the key difference between Dalvik and art is the way the bytecode is executed.