MAD Unit No 2 Notes
MAD Unit No 2 Notes
Contents:
2.1 Operating System, Java JDK, Android SDK
2.2 Android Development Tools (ADT)
2.3 Android Virtual Devices (AVDs)
2.4 Emulators
2.5 Dalvik Virtual Machine, Difference between JVM and DVM 2.6 Steps to install and
configure Android Studio and SDK
______________________________________________________________________
i.
JDK:
Java Development Kit (JDK) is a complete software environment for building
•
applications and applets using the Java programming language.
• It is platform-dependent.
• Therefore, it has different OS platform versions for Windows, Linux, Mac, etc. • It
allows reading, writing, and executing the Java program. • Includes various tools
required for writing Java programs. • It includes an applet viewer, Java application
launcher, debugger, compiler, etc.• JDK also consists of JRE for executing Java
programs. The Java application launcher helps in opening a JRE. Then, it loads the
necessary
•
details and executes the program’s main method.
JDK = Development Tools + JRE (Java Runtime Environment) ii.
JRE:
JRE software includes JVM and class libraries to run Java programs
•
independently.
• Although it can execute the code.
Yet, JRE comes bundled with Java Development Kit (JDK) to provide a complete
•
application development experience.
The JRE includes class libraries along with JVM and its supporting files.(Note: It
•
does not include separate tools, such as a debugger for Java development.)JRE
comprises significant package classes such as util, math, AWT, lang, and
•
various runtime libraries.
JRE = JVM + Class Libraries (For Running the Java Applications)
iii.
JVM:
Java Virtual Machine (JVM) is an abstract machine responsible for compiling and
•
executing Java code.
It is a part of the Java Runtime Environment (JRE), which calls the main function
•
of a program.
• JVM facilitates a platform-independent way of executing Java source code. Compiled by
SAYYED SHABANA USMAN___ Page 2
Eclipse J Andro An
C id iOS su
C++
C# Linux
JavaScr Ja
ipt MacOS
Python
more Windo
w
Free
(with
C
Platform
Experienced Proprietary, Free to
Windows
Xamarin) C# MacOS $2,999 +
Visual Studio
Windows
Linux
Code is Open
Visual
Android Source MIT
Free to
$499/year
Free
Free to
$394+
Free
Free
AIDE Java
Android
Android Amateurs or
ProprietaryFree with
C
Web
C++ in-app
mobile professionals purchases
•
To create a new AVD:
ii. Click + button, then select Create Virtual Device in the Device
Managerpanel.The Select Hardware window appears.
v.
Change the AVD properties as needed, and then click Finish. Click Show
Advanced Settings to show more settings, such as the skin.
The new AVD appears in the Virtual tab of the Device Manager and the
target device menu.
Compiled by SAYYED SHABANA USMAN___ Page 7
2.4 Emulators:
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.
The emulator comes with predefined configurations for various Android phone, tablet,
•
Wear OS, and Android TV devices.
•
In short, An Android emulator is an Android Virtual Device (AVD) that
represents a specific Android device.
You can use an Android emulator as a target platform to run and test your Android
•
applications on your PC.
• Using Android emulators is optional.
• To start the emulator:
1. Open the Device Manager.
2. Double-click on AVD, or click ►Run.
You can also drag one or more APKs onto the emulator to install them, and then run
•
them.
•
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.2
2.6 Steps to install and configure Android Studio and SDK: First, check the
•
version of Android Studio.
• Here are the system requirements for Windows:
Requiremen Minimum
t
OS 64-bit Microsoft
Windows 8
RAM 8 GB RA
Recommended
Latest 64-bit version of Windows
16 GB RAM or more
CPU x86_64 CPU architecture; 2nd
Latest Intel Core processor
generation Intel Core or newer, or
AMD CPU with support for a
Windows Hypervisor Framework.
resolution
Disk space 8 GB (IDE and Androi
Emulator)
Solid state drive with 16 GB or more
Screen 1280 x 800 1920 x 1080
iii.
Agree to terms and conditions. Then click on Download button. iv. Double-click
on downloaded file for Android Studio.
v. Click Next button.
vi. Select all components if not selected. Then click Next button.
x.
Android Studio setup completed. Then click Finish button.
xix.
Android Studio is ready for Mobile Application Development. Now you can
create projects for your Android Application.
Compiled by SAYYED SHABANA USMAN___ Page 18