Mobile Application
Development
LECTURE 03
Todays Agenda
Running the Android App Using Emulator
Java Virtual machine (JVM) vs (Dalvic VM)DVM vs (Android
RunTime)ART
Muhammad Bilal
Select a system image
Verify the AVD
configuration
Muhammad Bilal
Run the app in the emulator
Compile, package, deploy, and run
Muhammad Bilal
You can watch progress in the console
Muhammad Bilal
JVM vs DVM/ ART
Source Files
Source Files (.java)
(.java)
Compiler
(javac)
Compiler
(javac) Bytecode
(.class)
Bytecode Dex Compiler
(.class)
.dex file
JVM
DVM/ART
Native code/
Native code/
Machine code Machine code
JVM
1. Better than interpreter
2. But slower then C++ compiler
3. Specially designed for “write once, run every where”.
4. Platform independent
DVM
1. Use Just In Time (JIT) compiler.
2. Lead to slow app startup due to JIT.
3. Leads to faster boot time of the device, as app’s cache is built
at runtime.
ART
1. Use Ahead of Time (AOT) compiler.
2. AOT uses dex2oat (Of Ahead Time) tool to compile .dex (Dalvik
EXcutable) files and generates a compiled app to be run on the
target device.
3. Reduce startup time as native code is directly executed.