Information Technology Reference
In-Depth Information
Dalvik virtual machine
All the applications that you install on the Android device are written in the Java program-
ming language. When a Java program is compiled, we get bytecode. JVM is a virtual ma-
chine (a virtual machine is an application that acts as an operating system, that is, it is pos-
sible to run a Windows OS on a Mac or vice versa by using a virtual machine) that can ex-
ecute this bytecode. But Android uses something called
Dalvik virtual machine
(
DVM
) to
run its applications.
DVM runs Dalvik bytecode, which is Java bytecode converted by the Dex compiler (
ht-
the dx tool. Dalvik bytecode when compared with Jave bytecode is more suitable for low-
memory and low-processing environments. Also, note that JVM's bytecode consists of one
or more
.class
files depending on the number of Java files that are present in an applica-
tion, but Dalvik bytecode is composed of only one dex file. Each Android application runs
its own instance of Dalvik virtual machine. This is a crucial aspect of Android security and
will be addressed in detail in
Chapter 8
,
Android Forensic Setup and Pre Data Extraction
Techniques
. The following figure provides an insight into how Android's DVM differs
from Java's JVM.
JVM versus DVM