UNIT 2
Installation and Configuration of Android
Topics to be covered
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.
Operating System
An OS is system software that manages computer
hardware , software resources, and provides common
services for computer programs.
Act as an interface between the end user and
computer hardware. Every computer must have OS
to run other programs.
It is a specialized software that controls and monitors
the execution of all other programs that reside in the
computer, including application programs and other
system software.
Types of OS
Batch Operating System
Multitasking/Time Sharing OS
Real Time OS
Distributed OS
Network OS
Mobile OS
Batch Operating System
Some computer processes are very lengthy and time-consuming.
To speed the same process, a job with a similar type of needs are
batched together and run as a group.
The user of a batch operating system never directly interacts with
the computer.
In this type of OS, every user prepares his or her job on an offline
device like a punch card and submit it to the computer operator.
Time-sharing Operating systems
Time-sharing operating system enables people located at a
different terminal to use a single computer system at the same
time.
The processor time (CPU) which is shared among multiple users is
termed as time sharing.
Real time OS
A real time operating system time interval to process and respond
to inputs is very small. Examples: Military Software Systems,
Space Software Systems.
Distributed Operating System
Distributed systems use many processors
located in different machines to provide very
fast computation to its users.
Network Operating System
Network Operating System runs on a server.
It provides the capability to serve to manage
data, user, groups, security, application, and
other networking functions.
Mobile OS
Mobile operating systems are those OS which
is especially that are designed to power smart
phones, tablets.
Java JDK
JDK (Java Development Kit) Includes a
complete JRE (Java Runtime
Environment) plus tools for developing,
debugging, and monitoring Java applications.
JDK is required to build and run Java
applications and applets.
1.JVM
VM (Java Virtual Machine) is an abstract
machine.
It is a specification that provides runtime
environment in which java byte code can be
executed.
JVMs are available for many hardware and
software platforms (i.e. JVM is platform
dependent).
It is:
A specification where working of Java
Virtual Machine is specified. But
implementation provider is independent to
choose the algorithm. Its implementation has
been provided by Oracle and other
companies.
An implementation Its implementation is
known as JRE (Java Runtime Environment).
Runtime Instance Whenever you write java
command on the command prompt to run the
java class, an instance of JVM is created.
The JVM performs the following main task
Loads code
Verifies code
Executes code
Provides runtime environment
2.JRE
JRE stands for Java Runtime Environment
which is used to provide an environment at
runtime.
It is the cause of implementation of JVM .
It contains a set of supporting libraries in
combination with core classes and various
other files that are used by JVM at runtime.
JRE is a part of JDK (Java Development
Toolkit) but can be downloaded separately.
3.JDK
JDK (Java SE Development Kit) Includes a
complete JRE (Java Runtime
Environment) plus tools for developing,
debugging, and monitoring Java applications.
JDK is required to build and run Java
applications and applets.
Android SDK
The Android SDK (Software Development Kit) is a set of
development tools that are used to develop applications for
the Android platform.
This SDK provides a selection of tools that are required to
build Android applications and ensures the process goes as
smoothly as possible.
Whether you create an application using Java, Kotlin or C#,
you need the SDK to get it to run on any Android device.
You can also use an emulator in order to test the
applications that you have built
The Android SDK includes the following:
Required libraries
Debugger
An emulator
Relevant documentation for the Android
application program interfaces (APIs)
Sample source code
Tutorials for the Android OS
The Android SDK includes sample projects
with source code, development tools,
an emulator, and required libraries to build
Android applications.
Applications are written using
the Java programming language and run
on Dalvik, a custom virtual machine designed
for embedded use which runs on top of
a Linuxkernel.
Features of Android SDK
No licensing, distribution. Or development fees
Wi-fi hardware access
IPC message passing
Shared data store
An integrated open source webkit-based browser
Full support for application that integrate map
controls as part of their interface
Peer to peer support using goggle talk
Android Development Tools
1. Android Studio
Android Studio provides code editing,
debugging, and testing tools all within an
easy-to-use drag-and-drop interface.
It is free to download and is supported not
only by Google, but also by a large and
actively engaged community of Android
developers.
2. ADB (Android Debug Bridge)
Android Studio includes the Android Debug
Bridge, which is a command-line tool or
“bridge” of communication between Android
devices and other computers that can be used
during development and the overall
debugging
By connecting an Android device to the
development PC and entering a series of
terminal commands, a developer is able to
make modifications as needed to both
devices.
3. AVD Manager
Another useful feature of Android Studio is
the AVD Manager, the short form for Android
Virtual Device.
The AVD Manager is an emulator used to run
Android apps on a computer.
This allows developers the ability to work
with all types of Android devices to test
responsiveness and performance on different
versions, screen sizes, and resolutions.
4. Eclipse
For a long time, Eclipse was the officially
preferred IDE for all Android application
development.
Even though Google no longer offers support
for Eclipse, many developers still use it to
create Android and other cross-platform
apps, as it works very well with many
different programming languages.
5. Fabric
Fabric is the development platform behind
Twitter’s mobile application.
It gives developers the ability to build better
mobile apps by providing them with a suite of
“kits” that they can pick and choose from.
These kits include everything from beta-
testing to marketing and advertising tools.
Google purchased Fabric from Twitter in
January of 2017. Uber, Spotify, Square,
Groupon, Yelp, and more big-name companies
have utilized Fabric in developing their
mobile applications.
6. FlowUp
FlowUp allows you to monitor the
performance of all your production apps.
Handy dashboards let you keep track of your
stats and metrics, including CPU and disk
usage, memory usage, frames per second,
bandwidth, and more.
FlowUp is a monthly subscription-based SaaS
solution with pricing determined by the total
number of users in the company.
7. GameMaker: Studio
For Android game developers, one of the
most popular development tools
is GameMaker: Studio.
GameMaker provides everything you need to
create 2D games using very little code.
It is an extremely user-friendly application
with a simple drag-and-drop interface.
GameMaker: Studio is targeted to beginner
and novice gaming developers.
8. Genymotion
Another Android emulator, Genymotion helps
developers test and preview an application on over
3,000 device scenarios.
Genymotion is popular among gaming developers
because it comes with pre-installed standard
Android images and graphics that are quite useful
in the testing process.
It also provides greater speed than testing an app
on an actual Android device.
Genymotion is a cross-platform development tool
and supports many different programming
languages and environments.
9. Gradle
Gradle is one of the most popular
development tools for creating large-scale
applications involving Java.
Developers like using Gradle in conjunction
with Android Studio because it’s very easy to
add external libraries using a single line of
code.
10.IntelliJ IDEA
From the developers at Jet Brains, IntelliJ
IDEA is designed for ultimate programmer
productivity.
It’s extremely fast and features a full suite of
development tools right out of the box.
At $149 per year, IntelliJ IDEA certainly isn’t
cheap.
However, there is a free, open source
community edition available and the full
extended version is free to students for one
year
Android Virtual Devices
AVDs are essentially emulators that allow Android applications
to be tested without the necessity to install the application on a
physical Android based device.
An AVD may be configured to emulate a variety of hardware
features including options such as screen size, memory capacity
and the presence or otherwise of features such as a camera, GPS
navigation support or an accelerometer.
As part of the standard Android Studio installation, a number of
emulator templates are installed allowing AVDs to be configured
for a range of different devices.
Additional templates may be loaded or custom configurations
created to match any physical Android device by specifying
properties such as processor type, memory capacity and the size
and pixel density of the screen.
Check the online developer documentation for your device to
find out if emulator definitions are available for download and
installation into the AVD environment.
When launched, an AVD will appear as a
window containing an emulated Android
device environment. Figure 4-1, for example,
shows an AVD session configured to emulate
the Google Nexus 5X model.
New AVDs are created and managed using
the Android Virtual Device Manager, which
may be used either in command-line mode or
with a more user-friendly graphical user
interface.
Android AVD
A Hardware
sketch
Consist of
A mapping to a system Emulated storage(secure
AVD
image digital)
tests
Android
Emulators
The Android emulator is an Android Virtual Device
(AVD), which represents a specific Android device.
We can use the Android emulator as a target device to
execute and test our Android application on our PC.
The Android emulator provides almost all the
functionality of a real device.
We can get the incoming phone calls and text messages.
It also gives the location of the device and simulates
different network speeds.
Android emulator simulates rotation and other
hardware sensors.
It accesses the Google Play store, and much more
Testing Android applications on emulator are
sometimes faster and easier than doing on a
real device.
For example, we can transfer data faster to
the emulator than to a real device connected
through USB.
The Android emulator comes with predefined
configurations for several Android phones,
tablet, Android TV devices.
1. Requirements and Recommendations
The Android emulator takes additional
requirements beyond the basic system
requirement for Android Studio. These
requirements are given below:
SDK Tools 26.1.1 or higher
64-bit processor
Windows: CPU with UG (unrestricted guest)
support
HAXM 6.2.1 or later (recommended HAXM
7.2.0 or later)
2. Launch the android Emulatos without
first running an app
To start the emulator:
Open the AVD Manager.
Double-click an AVD, or click Run
While the emulator is running, we can run
the Android Studio project and select the
emulator as the target device. We can also
drag an APKs file to install on an emulator,
and then run them
Dalvik Virtual Machine (DVM)
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.
Dalvik is a name of a town in Iceland. 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 compiling and packaging process from the
source 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
Role of DVM
Difference between JVM and DVM
Steps to install and configure
Android Studio and SDK
System Requirements
Microsoft Windows 7/8/10 (32-bit or 64-bit)
Mac OS X 10.10 (Yosemite) or higher, up to
10.13 (High Sierra)
GNOME or KDE desktop.
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
Steps to install and configure Android
Studio and SDK
HAXM stands for "Hardware Accelerated Execution Manager". It
is used for launching Emulators and must be installed and in