Chapter 2
Chapter 2
JVM (Java Virtual Machine) acts as a run-time engine to run Java applications.
It provide runtime environment in which bytecode can be executed.
JVM is the one that actually calls the main method present in a java code. JVM is
a part of JRE (Java Runtime Environment).
Java applications are called WORA (Write Once Run Anywhere). This means a
programmer can develop Java code on one system and can expect it to run on any
other Java enabled system without any adjustment. This is all possible because of
JVM.
When we compile a .java file, .class files(contains byte-code) with the same class
names present in .java file are generated by the Java compiler.
The Dalvik Virtual Machine (DVM) is an android virtual machine optimized for
mobile devices.
Dalvik VM is also a virtual machine that is highly optimized for mobile devices.
Thus, it provides all the three things, that are memory management, high performance
as well as battery life.
It is strictly developed for Android mobile phones.
The Dex compiler converts the class files into the .dex file that run on the Dalvik VM.
Multiple class files are converted into one dex file.
The javac tool compiles the java source file into the class file.
The dx tool takes all the class files of your application and generates a single .dex file.
It is a platform-specific tool.
The Android Assets Packaging Tool (aapt) handles the packaging process.
JVM DVM
Uses byte code and runs .class file Use byte code and runs in .dex file.
Android Studio
Eclipse
Fabric
FlowUp
GameMaker: Studio
Genymotion
IntelliJ IDEA
The AVD Manager is an interface you can launch from Android Studio that helps you
create and manage AVDs.
Emulator
The Android SDK includes a virtual mobile device emulator that runs on your
computer. The emulator lets you prototype, develop and test Android applications
without using a physical device.
Usually by default when you launch the emulator, its orientation is vertical, but you
can change it orientation by pressing Ctrl+F11 key from keyboard.
The Android Emulator simulates Android devices on your computer so that you can
test your application on a variety of devices and Android API levels without needing
to have each physical device.
The emulator provides almost all of the capabilities of a real Android device. You can
simulate incoming phone calls and text messages, specify the location of the device,
simulate different network speeds, simulate rotation and other hardware sensors,
access the Google Play Store, and much more.
Testing your app on the emulator is in some ways faster and easier than doing so on a
physical device. For example, you can transfer data faster to the emulator than to a
device connected over USB.