Chapter-2 MAD (Android Development)
Chapter-2 MAD (Android Development)
Now you get a new AVD ready for launching your apps on it.
2.4 Emulators
• The Android Emulator simulates Android devices on
computer.
• The emulator allows us to test Android applications
without using a physical device..
• The emulator provides almost all of the capabilities of a
real Android device.
• We can simulate incoming phone calls and text messages,
specify the location of the device, access the Google Play
Store, and much more.
• An Android emulator is an Android Virtual Device (AVD)
that represents a specific Android device.
• The emulator comes with predefined configurations for
various Android phone, tablet, Wear OS, and Android TV
devices.
Advantages of emulator :
1. Flexibility: Emulator is able to simulate a variety of devices
and Android API levels. Also it comes with predefined
configurations for various Android phone, tablet, Wear OS,
and Android TV devices.
2. High fidelity (faithfulness ): The emulator provides almost
all the capabilities of a real Android device. Such as incoming
phone calls and text messages, location of the device,
hardware sensors and much more.
3. Speed: Testing the app on the emulator is faster and easier
than doing so on a physical device. For example, we can
transfer data faster to the emulator than to a device
connected over USB.
Requirements of Android Emulator
– 16 GB RAM
– 64-bit Windows, macOS, Linux, or Chrome OS
operating system
– 16 GB disk space
– HAXM 6.2.1 or later (HAXM 7.2.0 or later
recommended)
HAXM(Intel Hardware Accelerated Execution
Manager)
Run your app on the emulator
• After you have created an AVD, you can start the Android
Emulator and run an app in your project
1. In the toolbar, select the AVD from the target device menu.
2. Click Run.
Once your app is installed on your AVD, you can run it from the
virtual device. Any time you want to deploy new changes, you
need to click Run or Apply Changes again.
Dalvik Virtual Machine
• The Dalvik Virtual Machine (DVM) is an android
virtual machine optimized for mobile devices.
• It optimizes the virtual machine for memory, battery
life and performance.
• The Dalvik VM was written by Dan Bornstein.
• 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.
2.5 Difference JVM & DVM
2.6 Steps to install and configure
Android Studio and SDK
• Windows requirements
– Microsoft Windows 7/8/10 (32-bit or 64-bit)
– 3 GB RAM minimum, 8 GB RAM recommended (plus 1 GB
for the Android Emulator)
– 2 GB of available disk space minimum, 4 GB recommended
(500 MB for IDE plus 1.5 GB for Android SDK and emulator
system image)
– 1280 x 800 minimum screen resolution
– Intel processor for accelerated emulator(HAXM)
– Android SDK
Steps to install and configure
Android Studio and SDK
• 1)launch android-studio-ide-181.5056338-windows.exe to
start the installation process. Android Studio Setup dialog
box shown in Figure 1.
Steps to install and configure
Android Studio and SDK