2..
Installation and
Configuration of Android
Chapter Outcomes...
the specified IDE.
Describe function of the given component to operate
virtual machine.
D Explain the given term related to development tools.
Explain the given basic term related to Android
Describe the features of given Android emulator.
android development environment.
D Describe the steps to configure the given
|Learning Objectives...
To learn Android Installation
Tostudy Configuration of Android
2.0 INTRODUCTION
Android Studio is Google's officially supported IDE for developing Android apps. Android is
an Operating System for mobile devices developed by Google, which is built upon Linux kernel.
In this chapter, anew android learner/beginner will have abrief understanding of Android SDK and
Android ADT. We will also learn about the concepts like Android AVD, Dalvik Virtual Machine (DVM)
and to know how to do installation of eclipse and SDK.
2.1 OPERATING SYSTEM
To develop an Android program, the necessary supporting operating systems used in a computer can
be as follows:
1. Windows XP (32-bit), Vista (32-bit or 64-bit) or Windows 7 (32-bit or 64-bit) Windows 8/10 (32-bit
or 64-bit).
2. Mac OS X(10.5.8 or later (Intel chips only).
3. Linux (Ubuntu Linux version 8.04 or later and GNU CLibrary 2.7 or later).
2.1.1 Java JDK
AnAndroid operating system program is developed in the Java programming language we have to
install Java Development Kit (DK) in computer which is free software where the JDK includes the
Java SE Runtime JRE).
Android Studio uses the Java tool chain to build, so we need to make sure that we have the Java
Development Kit (DK) installed on the computer before we start using Android studio.
2.1.2 Android SDK (w-22)
The Android Software Development Kit (SDK) allows developers to create applications for the
Android platform. The Android SDK is the most important software of android which is installed.
(2.1]
Mobile Application Development 2.2 Installation and Configuration of Android
The Android sDK provides to test android applications, the API libraries, an emulator,
documentation, sample code, developer tools, and tutorials which help us to build, test and debug
apps from Android.
Android SDK
Debugger Libraries Emulator Documentation Sample Tutorials
Code
Fig. 2.1: Android SDK Components
The android SDK provides the tools and Application Programming Interfaces (APis) for
create applications on the Android platform using the Java developers to
Android SDK can be downloaded from
programming language.
Manager which is free.
[Link] using Android SDK
We find the Android SDK in a zip file and have to unzip its contents intoa
folder. We can also create
Android Virtual Devices (AVD)via the Android SDK, which run in the emulator.
Android SDK is made up of two main parts namely, the tools and the packages. When we first install
the SDK, all we obtain are the basic tools. These are executables and supporting files that
will help us
to develop applications.
Some Android sDK, features include:
1 No licensing, distribution,or development fees.
2. Wi-Fi hardware access.
3. IPC message passing.
4. Shared data stores.
5. An integrated open source WebKit-based browser.
6. Fullsupportfor application that integrate Map controls as part of their interface.
7. Peer-to-Peer (P2P) support using Google Talk.
Platform Used:
To develop Android application we use the Android Studio, Android Debug Bridge, AVD Manager,
Eclipse, Intellij and AIDE different Integrated Development Environment (IDEs) which supports
multiple languages such as Java, C, C++, COBOL, Python, etc. It is such type of environment upon
which the extensible plug-in can run.
2.2 ANDROID DEVELOPMENT TOOLS
In Android it is necessary to connect Eclipse with the Android SDK. Linking is
represented by the
plugin named Android Development Tool (ADT), which extends the capabilities of Eclipse and allowS
the rapid development of Android projects or apps.
ADT in Android is aplugin for the Eclipse IDE which provides a suitable environment to develop an
Android application where creation, compilation and debugging are possible.
ADT in Android can able to set up new Android projects, create an
application UI, inset packages
based on the Android Framework API, debug (or clear-up) our applications using the
Android SDK
tools and export signed (or unsigned) .apk files in order to distribute in the application.
Also Android ADT provides custom XML editors and debug output
pane from which we get the
unbelievable enhance during develop the Android applications.
Android Developer Tools Bundle (ADT Bundle) provides Eclipse + ADT plugin, Android SDK Tools,
Android Platform. Tools, Most recent Android platform, Newest Android system image for
the
emulator and so on.
Ingtallatlon and Contlguration of
Moblle Appllcation Devolopment 2.3
Androlg
Create a new
Androld applicatlon
Compile and
Create an ADT debug Android
Application applicatons
Create digital certificates
Access the tools
for accessing the
for code-singing of APK
(Android Application
Android emulators
and devices
Packages)
Fig. 2.2: Android ADT (Functions)
1. Android Studio:
(|DE) for all Android applications, Androjd
As the official Integrated Development Environment
developers.
Studioalways seems to top the list of preferred tools for
V:.00
rold stidlo
Fig. 2.3: Android Studio
Google created Android Studio back in 2013. It replaced or should we say it eclipsed? Eclipse
Android
Development Tools (ADT) as the primary IDE for native Android app development.
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 incBudes the Android Debug Bridge, which is a
command-line tool or "bridge
communication between Android devices and other computers that can be used during developme
and the overall debugging and QA (Quality
Assurance) process.
By connecting an Android device to the development PC and
entering a series of termiuia
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 Virtua
Device.
Mobile Appiication Development 2.4 Installation and Configuration of Android
The AVD Manager is an emulator used to run Android apps on a computer. This allows developers the
ability to work with alltypes of Android devices to test responsiveness and performance on different
versions, screen sizes, and resolutions.
4. Eclipse:
As we mentioned above, there was Eclipse before there was Android Studio. 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 stilluse 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 tomarketing 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. Flowüp:
FlowUp allowsus tomonitor the performanceof all our production apps. Handy dashboards let us
keep track of our stats and metrics, incuding CPU and disk usage, memory usage, frames per
second, bandwidth and more.
FlowÜp is a monthly subscription-based SaaS solution with pricing determined by the total number
of users in the company.
7. GameMaker Stdio
For Android game developers, one of the most popular development tools is GameMaker: Studio.
GameMaker provides everything we need tocreate 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 leamer gaming developers.
8. Genymotion:
Another Android emulator, Genymotion helps developers test and preview an application on over
3,000device 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 across-platform development tool and supports many different programming
languages and environments.
9. Gradle:
Back in 2013, GOogle endorsed Gradle as a build system for Android apps. Based on Apache Maven
and Apache Ant, 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
externallibraries using a single line of code.
10. Intellij IDEA:
From the developers at JetBrains, 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'tcheap. However, there is a free, open source
community
edition available and the full extended version is free to students for one year.
2.5 Installatlon and Configuration of Androe
Moblle Appllcation Dovolopment
VIRTUAL DEVICE (AVD) (W-22)
2.3 ANDROID represents a device configuration. An AVD is a configuration
that
Android Virtual Device (AVD) Wear Os, Android TV, or Automotive Os
An phone, tablet,
characteristics of an Android Emulator.
defines the
want to simulate in the Android by calling hardware and
device that we configuration that enables to model an actual device
An AVD is an
emulator Emulator.
be emulated by the Android Studio that helps us to
crents
software options to from Android
interface we can launch
The AVD Manager is an
do one of th
manage AVDs.
Android applications. To open the AVD Manager,
the
An AVD is used for testing
following:
Manager.
Select Tools ’ AVD
lin the tooibar.
Click AVD Manager
A hardware sketch
Consists of
AVD
Emulated storage (secure digital)
A
mapping to a system image
tests
Android
Fig. 2.4: Android AVD
Things about AVDs:
An AVD Contains a hardware profile, system image, storage area, skin, and other properties. we
recommend that we create an AVD for each system image that our app could potentially suppOt
based on the <uses-sdk> setting in our manifest.
1. Hardware Profile:
The hardware profile defines the characteristics of a device as shipped from the factory. The AVD
Manager comes preloaded with certain hardware profiles, such as Pixel devices and we can define or
customize the hardware profiles as needed.
Notice that only some hardware profiles are indicated to include Play Store. This indicates that these
profiles are fully CTS compliant and may use system images that include the Play Store app.
2. System Images:
Asystem image labeled with Google APIs includes access to Google Play services.
Asystem image labeled with the Google Play logo in the Play Store column includes the Google Play
Store app and access to Google Play services, inchuding a Google Play tab in the
Extended contro
dialog that provides a convenient button for updating Google Play services on the device.
To ensure app security and a consistent experience with physical
devices, system images with u
Google Play Store included are signed with a release key, which means that we cannot get elevated
privileges (root) with these images.
If we require elevated privileges (root) to aid with our app troubleshooting, we can use the Androv
Open Source Project (AOSP) system images that do not include Google apps or services.
Mobile Application Development 2.6 Installation and Configuration of Android
3. Storage Area:
The AVD has a dedicated storage area on our development machine. It stores the device user data
such as installed apps and settings, as well as an emulated sD card.
lI needea, we can use the AVD Manager to wipe user data, so the device has the same data as if it
were new.
4. Skin:
An emulator skin specifies the appearance of a device. The AVD Manager provides some predefined
skins. We can also define our own,or use skins provided by third parties.
5. AVDand app Features:
Be sure our AVD definition includes the device features our app
depends On.
2.4 EMULATORS
Android Emulator is responsible for running,debugging and testing the Android application.
The Android SDK comes with a virtual mobile device emulator that rums on the computer. The
emulators enables us trail product to develop android application without using a physical device.
The Android Emulator mimics all the hardware and software features of typical mobile devices,
except that it cannot place annual phone calls.
It provides a selection of navigation and control keys which we can "press" using our mouse or
keyboard to generate events for our applications. If provides a screen in which our application is
displayed together with any other active android applications.
The Android Emulator runs on a full Android system stack, down to the kernel level including a set
of preinstalled applications that we can access from our applications.
We can select the version of the android system we wish to run in the emulator by configuring AVDs,
and we can also modify the mobile device skin and key mappings.
While launching the emulator at the runtime, we can use a variety of commands and options to
control its behavior.
The Android emulator offers dynamic binary translation of device machine code to the OS and
processor architecture of our development machine.
In short AndroidEmulator tool helpsto start the emulator from the command line.
2.5 DALVIK VIRTUAL MACHINE (DVM) (S-22)
Dalvik is a register-based Virtual Machine (VM) that's been optimized to ensure that a device can run
multiple instances efficiently.)
The DVM uses the device's underlying Linux kernel to handle low-level functionality including
security, threading and process and memory management. ]
It is also possible towrite C/C++ applications that run directly on the underlying Linux os. While we
can dothis, in most cases there's noreason we should need to.
Google selected Java as the language for developing Android applications, thereby it got away with
both JME and the JVM in favour of an alternate development target, the Dalvik virtual machine.
Google have also chosen to use an alternative and limited implementation of the standard IAVA
libraries, Both of these are unusual Java and effectively represent fork of the Java platform.
The key figure in Google'simplementation ofJVM is Dan Bornstein, who has written the Dalvik VM
Dalvik is the name of a town in Iceland.
Dalvik VM takes the generated Java class files and combines them into one or more Dalvik Executable
,dex) files. It reuses duplicate information from numerous class files, effectively reducing the gap
requirement by half from a traditional .jar file.J
Android Os uses the Dalvik Virtual Machine (DVM) with just-during-time compilation to run Dalvik
bytecode, which is frequentaly translated from Java bytecode.]
Google has also fine-tuned the garbage collection in the Dalvik VM, but it has chosen to remove Just
In-Time JIT) compiler, in early releases. Android 2.3 has added JIT.
Moblle Appllcatlon Development 2.7 Inetallatlon and Conflguratlon of Andrale
Dalvik VM use a different kind of assembly -code generation, in which it uses registers as the primar
units of data storage instead of the stack.
The Dalvik VM relies on the Linu.
Google expects to accomnplish 30% lesser instructions as a result.
memory management.
Kernel for underlying functionality such as threading and low-level
as a result of the Dalvik VM, is basod
(We must remember that the final executable code in android
cannot directly execute Java byte code.
not on Java byte code but on .dex files instead. This means we
converts them to linkable .dex files.)
we have tostart with Java class files and then android SDK use
Android SDK. For example, the
This performance is extended into the rest of the
XML extensively to define UI layouts.
these binary files become resident on the
However, all of this XML is complied to binary files before
devices. Android provides special mechanisms to use this XML data.
files, which are in turn zipped into a
Android programs are complied into .dex (Dalvik Executable)
automatically translating compiled
single .apk file on the device .dex files can be created by
applications written in the Java Programming language.
Machine (DVM) to run Java based
The android uses a particular virtual machine i.e. the Dalvik Virtual
applications.
mobile phones and
(Dalvik is a vital part of Android which is normally use mobile devices such as
streamers etc.
tablet computers, embedded devices for example smart TVs and media
code which is
Dalvik can use own byte format i.e. Dalvik byte code which is different from Java byte
different from Java byte code.J
So Java class files can not directly run on android, they need to get converted in the Dalvik byte code
format which is compiled by the Dex compiler. )
jar .apk
.class .dex
Header Magic Numbers Header
Magic Number
Vesion of Class Checksum
file format SHA-1
Signature other Strings
Constant Pool Heterogeneous Constant Pool
Constant Pool
Access Flags Type/Class
This Class Super Class Constant Pool
class Interfaces
Field constant
Constant Pool Field
Pool
Method
Methods Method Constant Pool
Class
Attributes Attributes Definitions
Field List
.class Code Header
Local Variables
.class
Fig.2.5: Android Dalvik Virtual Machine (DVM)
Mobile Application Developmont 2.8 Installation and Configuratlon of Android
DVM in Android operating system contains
following:
1. Fle Header: Dex files start the simple header with some checksums and
offsets to other
structures.
2. Notes: All non-string fields are stored in little-endian format. It would appear that the checksum
and signature fields are assumed to be zero when calculating the checksum and
signature.
3. String Table: This table stores the length and offsets for every string in the dex file inciuaing
string constants, class names, variable names and
4. more.
Class List: A list of all classes referenced or contained in this dex
5.
file.
Field Table: A table of fields of all casses defined in this dex
file.
6. Method Table: A table of methods of all classes in this dex file.
7. ClaSs Definition Table: A table of class definition for all classes either defined in this dex file or
has a method or field accessed by code in this dex file.
8. Pled List: Stores data for pre-initialized fields in a class. The list is formed of a 32-bit integer
containingthe number of entries followed by the entries themselves.
9. Method List: Alist of methods for a particular class. Begins with a 32 bit integer that contains the
number of items in the list.
[Link] Header: This header contains the information about the code that implements the
methods.
11. Local Variable List: Alist of variables for a particular method. Begins with a 32 bit integer that
contains the number of items in the list.
2.5.1 Difference between Java Virtual Machine (JVM) and Dalvik Virtual
Machine (DVM) (S-22)
Fig. 2.6 shows concept of JVM and DVM.
Java Source Code Java Source Code
Java
Compiler Java
Compiler
Java Byte Code Java Byte Code
Compiler
Dex
Java Byte Code
by JVM
Dalvik Byte Code
Dalvik Executable
by DVM
(a) JVM (b) DVM
Fig. 2.6
Moblle Application Development 2.9 Installation and Configuration of Androi
Following table differentiate between JVM and DVM:
Sr. No. JVM DVM
1 JVM supports multiple operating systems. DVM supports only Android Operating System.
.dex byte code file
2. JVM forms separate classes in separate DVM forms multiple class in
.class byte code files.
3 It is based on stack based virtual machine It is based on register based virtual machine
architecture. architecture.
DVM uns on less memory.
4. JVM runs on mnore memory.
The executable format of JVM is JAR. The executable format of DVM is APK.
6. JVM has different constant pools. DVM has common constant pool.
7. It [Link] byte code directly. The .class byte codes are optimized to .odex
format before executing in DVM.
AND SDK
2.6 STEPS TO INSTALL AND CONFIGURE ANDROID STUDIO (W-22)
step is to
Before any work can begin on the development of an Android application, the first
configure a computer system to act as the development platform.
This involves a number of steps consisting of installing the Android Studio Integrated Development
Environment (IDE) which also includes the Android Software Development Kit (SDK) and OpenjDK
Java development environment.
2.6.1 System Requirements
Android application development may be performed on any of the following system types:
1. Windows 7/8/10 (32-bit or 64-bit).
2. MACOS 10.10 or later (Intel based systems only).
3 Linux systems with version 2.19 or later of GNU C Library (glibc).
4. Minimum of 3GB of RAM (8GB is preferred).
5. Approximately 4GB of available disk space.
6 1280 x 800minimum screen resolution.
2.6.2 Downloading the Android Studio Package
Most of the work involved in developing applications for Android will be performed using the
Android Studio environment. The content and examples in this book were created basedon Android
Studio version 3.2 which at the time writing is the current version.
The latest release of Android Studio may be downloaded from the primarydownload page which can
be found at the following URL:
[Link] com/studio/index . html
2.6.3 Installing Android Studio
Once, downloaded, the exact steps to install Android Studip differ depending on the operating
system on which the installation is being performed.
[Link] Installation on Windows
Locate the downloaded Android Studio installation executable file, (named android-studio-ide
<version>-[Link]) in a Windows Explorer window and double-click on it to start the
installation process, clicking the Yes button in the User Account Control dialog ifit appears.
Once, the Android Studio setup wizard appears, work through the various screens to configure te
installation to mneet our requiremnents in terms of the file system location into which Android stuo
should be installed and whether or not it should be made available to other users of the system.
Mobile Application Development 2.10 Installation and Configuration of Android
When prompted to select the components to install, make sure that the Android Studio, Android SDK
and Android Virtual Device options are all selected.
Although there are no strict rules on where Android Studio should be installed on the system, the
installation was performed into CAProgram Files\VAndroid\Android Studio and that the Androia
SDK packages have been installed into the user's ApDData\LOcal\Android\sdksub-folder. Once, the
options have been configured, click on the Install button to begin the installation process.
On versions of Windows with a Start menu, the newly installed Android Studio can be launched
from the entry added to that menu during the installation.
The executable may be pinned to the task bar for easy access by navigating to the Android Studio\bin
directory, right-clicking on the executable and selecting the Pin to Taskbar menu option.
Note that the executable is provided in 32-bit (studio) and 64-bit (studio64) executable versions. 1T we
are running a 32-bit system be sure to use the studio executable.
[Link] Installation on MAC OS
Android Studio for MAC OS is downloaded in the form of a disk image (.dmg) file. Once, the androld
studio-ide-<version>-[Link] has been downloaded, locate it in a finder window and doubie
click on it to open it as shown in Fig. 2.7.
Ardrd Studio 2.0
Android
Studio
ABdrc:cG Stug
Fig. 2.7: Installation Wizard on MAC OS
To installthe package, simply drag the Android Studio icon and drop it onto the Applications folder.
The Android Studio package will then be installed into the Applications folder of the system, a
process which will typically take a few minutes to complete.
Tolaunch Android Studio, locate the executable in the Applications folder using a Finder window
and double-click on it.
For future easier access to the tool, drag the Android Studio icon from the Finder window and drop it
onto the dock.
[Link] Installation on Linux
Having downloaded the Linux Android Studio package, opena terminal window, change directory to
the location where Android Studio is to be installed and execute the following command:
unzip /<path to package>/android-studio-ide-<version>-[Link]
Note that the Android Studio bundle will be installed into a sub-directory named android-studio.
Therefore, assuming that the above command was executed in /home/demo, the software packages
will be unpacked into /home/demo/android-studio.
To launch Android Studio, open a terminal window, change directory to the android-studio/bin sub
directory and execute the following command:
./studio. sh
2.11 Installation and Configuration of Andros
Mobile Appilcation Development
install some 32-bit support librar
When runningon a 64-bit Linux system, it will be necessary to
can be installed using the followi
before Android Studio will run. On Ubuntu these libraries
command:
libbz2-1.0:139e
11bncurses5: 1386 libstdc++6:1386 lib32z1
Sudo apt-get install libc6: 1386
following command:
On RedHat and Fedora based 64-bit systems,use the
-libs.i686 bzip2 -libs. i686
sudo yum install zlib.i686 ncurses
2.6.4 AndroidStudio Setup Wizard
being installed, a dialog will appear providine
The first time that Android Studio is launched after
Android Studio version.
theoption to import settings from a previous to import them into the latest installation
from a previous version and would like
If we have settings
Alternatively, indicate that we do not need to import any
select the appropriate option and location.
previous settings and click on the OK button to proceed.
2.8 though this dialog does not appear on all
Next, the setup wizard may appear as shown in Fig.
platforms.
Welcome
etivironment for Android Studio.
Welcome ThiS wZsrd wiil set Lp your deve iopmont
Android Studio
Addit1nally, tthe wzard wll he'p port exis ting Andrord apps into
Gr create a ney Android applcation projec
Cancel
Fig. 2.8: Android studio setup Wizard
If the wizard appears, click on the Next button, choose the Standard installation option and click on
Next once again.
Android Studio will proceed to download and configure the latest Android SDK and some additional
components and packages. Once this process has completed, click on the Finish button in the
Downloading Components dialog at which point the Welcome to Android Studio screen should then
appear, (See Fig. 2.9).
Welsoe (9 Android Studlo
AndroidStudio
Start a new Android Studio project
n Open an oxisting Android Studio project
Cheok out project fron Version Control
Prolko or debug APK
# import project (Gradie, Eclipse AUT, etc.)
9 mportan Android code tomple
Configure Got Holp
Fig. 2.9
Mobile Application Development 2.12 Installation and Configuration of Androld
2.6.5 Installing additional Android SDK Packages
The steps performed so far have installed Java, the Android Studio IDE and the current set of default
Android sDK packages. Before proceeding, it is worth taking some time to verify which packages are
installed and to install any missing or updated packages.
This task can be performed using the Android SDK Settingsscreen, which may be launched from
within the Android Studio tool by selecting the Configure -’ SDK Manager option from within the
Android Studio welcome dialog.
Once, invoked, the Android sDK screen of the default settings dialog will appear as Showi
Fig. 2.10.
Detaut Preferences
Appearance &Behavior Systerm Settings >Android SDK
Appearance &Bahavior Manager for the Android SOK and Tools used ty Android Studio
Appesrance Andraid SDK Locatiot: Edit
anus and Tasibars jUsers/neilsmyihjLibrary!Androklísdk
System Settings og sOK Toois SOK Update Sites
Dasswards Each Android SD& Platforn packugo inciudes ihe Androki platlarm and sourcOs pertaining to an
HYTP Aroxy APIievel by defauit. Once Instalies, Ardroid Studio wii automaticaily check fof updates. Check
*show package detalis" to display individial SDX compnents.
Updates AP LAv Stats
Jsage Statistics
Name
Arndroid 8.0 (Oruo)
Ardroid 7.1,1 (Nougat)
26
25 3
[Link] instalied
Updste availabio
NOt irstaied
Androic 7.0 (NOugat) 24
Notitications Android 6.0 ([Link]) 23 Update availabie
Ouick Lists Ardroid 5.1 (Lolipos} 22 2 Not icstuied
Patt. Variabies Aridroid 5.0 (Lotipop) 23 Not installsd
Android 4,4W (KitKat Wear) 20 Not irstsied
Keymap Android 4.4 (Kitkat) Not irstaliod
Editor Androld 4.3 Jciiy Bean) Not irstaaed
Plugins Android 4.2 (Jeiiy 3ean) Not icstalied
Bulid, Execution, Deployment Androic 4.1 iJely Been) Not instaied
Android 4.0.3 (keCreamsandwich) Not irstaiied
Tools
Ardroii 4,0 iceCroamSandyich 4 Not icstaled
Show Package Details
? [Link]
Fig. 2.10
The Android SDK has been installed. To install older versions of the Android SDK simply select the
checkboxes corresponding to the versionsand click on the Apply button.
It is also possible that updates will be listed as being available for the latest SDK. To access detailed
information about the packages that are available for update, enable the Show Package Details
option located in the lower right-hand corner of the screen. This will display information similar to
that shown in Fig. 2.11.,
Name API Level Revision Status
Android TV intel X86 Atom System Image 25 6 Not installed
Android Wear for ChinaARM EAB0v7a System image 25 3 Not installed
Android Wear for China Intel x86 Atom System Image 25 3 Not installed
Android Wear ARM EABIV7a System Image 25 3 Not installed
Android Wear Intel x86 Atom System Image 25 Not installed
Googie APis ARM 64 V8a System mage 25 Not installed
Google APis ARM EABI v7a System Image 25 Not installed
Google APis intel x86 Atom System Image 25 Not insalad
Google APIs intel x86 Atom_64 System image 25 Update Available: 8
Android7.0 (Nougat)
Google APls 24 Not installed
Fig. 2.11
The Fig. 2.11 highlights the availability of an update. To install the updates, enable the checkbox to
the left of the item name and click on the Apply button.
In addition to the Android SDK packages, a number of tools are also installed for building Android
applications. To view the currently installed packages and check for updates, remain within the SDK
settings screen and select the SDK Tools tab as shown in Fig, 2.12.
Mobile Application Development 2.13 Installation and Configuration of Andrl
Appearance&Behavior System Settings > Android SDK
Appearance & Behavior Manaçe for tho Araraid SOX ang Tocis usea ey Andrcia tualo
Ardoic SDK Locatiar: iJSors!nesythicrary/Araroid/sdk
ARpearance
Menus ang Taolbars SOK ops SDX Uste Sites
SOK Plstlorms
5ystem Suttings instaisac, Androio uMi w &UtOsficsy
Boic are thos b 0 SOK aoveionr toois, O1co
avalaile vorslns of n SOK loci
Pss5words check tor updates. Check "shov pockege detas" o disouy Ststuy
HI2roxy
Ugcates N 0st8led
GPU i u n a tcols Nat instailed
Usago Stat stics
NOt nStalg
LLOS Net inst si
Noifications Anaroid Auto AP Simuistors
1.1 NoI in1aa
Anoroiu Auio Desktop eud Un emulei Uodate Avsilabie. 28.4
Qicx sts 25.1 3
Patn Varlobles 2600 stald
Andrcia SK Porforr-Tosls Updaie Avaiwbie: 28.1.0
Keymap Anrod SK Tocis 25.0 2
Not instail
Dccumgntation t r Androia SoK
Ecitor Net instsilxi
Gocgk Diay APK ExpBnsior yuty hstelled
Plugins 83 Ooogíz Piey elng Library
Nut instailus
Build, Execution, Deploymett GOgie Pay Uc!sng Lio ary
Tools
Show Package Delais
Fig. 2.12
Within the Android SDK Tools screen, make sure that the follOwing packages are listed as Installed in
the Status column:
1 Android SDK Build Tools.
2. Android Emulator.
3. Android SDK Platform Tools.
4. Android SDK Tools.
5 Google Play Services.
6 Instant Apps Development SDK.
7. Intel x86 Emulator Accelerator (HAXM Installer).
8. ConstraintLayout for Android.
9. Solver for ConstraintLayout.
10. Android Support Repository.
11. Google Repository.
12. Google USB Driver (Windows only).
In the event that any of the above packages are listed as Not Installed or requiring an update, sim y
select the checkboxes next to those packages and click on the Apply button to initiate the installation
process.
Once, the installation is complete, review the package list and make sure that the selected packages
are now listed as Installed in the Status column. If any of them are listed as Not installed, make sure
they are selected and click on the Apply button again.
2.6.6 Making the Android SDK Tools Command Line Accessible
Most of the time, the underlying tools of the Android sDK will be accessed from within the Android
Studio environment. However, there will also be instances where it will be useful to be able to invoke
those tools from a command prompt or terminal window.
In order for the operating system on which we are developing tobe able to find these tools, it will be
necessary to add them to the system's PATH environment variable.
Regardless of operating system, the PATH variable needs to be configured to include the following
paths (where, <path_to_android_sdk_ installation>represents the file system location into which the
Android SDK was installed):
<path to android_sdk_installation>/sdk/tools
<path_to _android_sdk_installation>/sdk/tools/bin
<path to _android _sdk_installation>/sdk/platform-tools
The location of the SDK on our system can be identified by launching the SDK Manager and rerer
to the Android SDK Location: field located at the top of the settings panel as highlighted in Fig. 2.
Mobile Appllcation Development 2.14 Installation and Configuration of Android
Appearance & Behavior >System Settings > Android SDK
Manager for the Android SDK and Tools
used by Android Studio
Android sDK Location:
rs/neilsmyth/Library!Android/sdk Edit
SOK Platforms SDK Tools SDK Update Sites
Below are the avaiable SDK developer toois. Once installed, Android
Check for updates. Check "shoW packagc details" to display Studio wili automatically
available versions of an SDK TOO.
Fig. 2.13
Once, the location of the SDK has been identified. the steps to add this to
the PATH variable are
operating system dependent.
[Link] Windows 7
Right-click on Computer in the desktop start menu and select Properties from the resulting menu.
In the properties panel, select the Advanced System Settings link and, in
on the the resulting dialog, clhCk
Environment Variables.
In the Environment Variables dialog, locate the Path variable in the System
and click on Edit. Locate the end of the current variable value string and variables list, select it
append the path to the
Android platform tools to the end, using a semicolon toseparate the path from the preceding values.
For example, assuming the Android sDK was installed into,
C:\Users\demo\AppData\Local\ Android\sdk,
the following would be appended to the end of the current Path value:
C:\Users\demo\AppData\Local\Android\sdk\platform-tools
C:\Users\demo\AppData\ Local\Android\sdk\tools
C:\Users\demo\AppData\ Local\Android\sdk\tools\bin
Click on OK in each dialog box and close the system properties control panel. Once,
the above steps
are complete, verify that the path is correctly set by opening a
(Start All Programs ’ Accessories ’ Command Prompt)and at the
Command Prornpt window
prompt enter:
echo %Path%
The returned path variable vaBue should include the paths to the Android SDK
platform tools foiders.
Verify that the platform-tools value is correct by attempting to run the adb tool:
adb
The tool should output a list of command lineoptions when executed. Similarly,
setting by attempting to launch the AVD Manager command line tool (don't worrycheck the tools path
if the avdmanager
tool reports a problem with java -this will be addressed later):
avdmanager
In the event that a message similar to the following message
appears for one or both of the
commands, it is most likely that an incorrect path was appended to the Path environment
Variable: 'adb' is not recognized as an internal or externalcommand, operable program or batch file.
[Link] Windows 8
On the start screen, move the mouse to the bottom right-hand corner of the
screen and select Search
from the resulting menu. In the search box, enter Control Panel. When the Control Panel icon
appears in the results area, click on it to launch the tool on the desktop.
Within the Control Panel, use the Category menu to change the display to Large Icons. From the list
of icons select the one labeled System.
Follow the steps outlined as Windows 7.
[Link] Windows 10
Right-click on the Start menu, select Settings from the resulting mnenu and enter "Edit the system
environment variables" into the Find a setting text field.
In the System Properties dialog, click the Environment Variables... button. Follow the steps
as Windows 7.
outlined
[Link] Linux
On Linux, this configuration can typically be achieved by adding a command to the .bashrc file in
our home directory (specifics may differ depending on the particular Linux distribution in use).
Mobile Appllcation Deveiopment 2.15 Installatlon and Conflguration of Andrel
Assuming that the Android sDK bundle package was installed into /home/demo/Android/sdk. h
export line in the .bashrcfile would read as folows:
export PATH=/home/ demo/ Android/sdk/plat form-tools : /home/ demo/Android/ sdk/tools : /home
/demo/Android/ sdk/tools/bin:/home/demo/android-studio/bin:$PAu
Note also that the above command adds the android-studio/bin directory to the PATH variable. Thie
will enable the [Link] script to be executed regardless of the current directory within a termina
window.
[Link] MAC OS
A number of techniques may be employed to modify the $PATH environment variable on MAC 08
Arguably the cleanest method is to add a new file in the /etc/[Link] containing the pathe
to be added to ^PATH.
path m2
Assuming an Android SDK installation location of /Users/demo/Library/ Android/sdk, the
be configured by creating a new file named android-sdk in the letc/paths.d directory containing the
following lines:
/Users/demo/Library/Android/sdk/tools
/Users/ demo/Library/Android/sdk/tools/bin
/Users/demo/ Library/Android/sdk/platform-tools
command when
Note that since this is a system directory which will be necessary to use the sudo
creating the file. For example:
sudo vi /etc/paths. d/android- sdk
2.6.7 Updating Android Studio and the SDK
From time to time new versions of Android Studio and the Android SDK are released. New versions
of the SDK are installed using the Android sDK Manager. Android Studio will typicaly notify us
when an update is ready to be installed.
To manually check for Android Studio updates, click on the Configure ’ Check for Update menu
option within the Android Studio welcome screen, or use the Help ’ Check for Update menu optior
accessible from within the Android Studiomain window.
Practice Questions
1. What is os? Explain OS requirements for Android.
2 What is JDK?
3. What is SDK?
4 How to install Android Studio?
5. Describe DVM with diagram.
6 What is JVM? Compare JVM and DVM.
7 Explain the term emulator in detail.
8. What is AVD?
9. What is ADT? Describe in detail.
10. Differentiate between JDK andSDK.
11. Explain how to configure Android studio and SDK.
12. Define the terms: JDK, SDK, AVD, ADT.
13. Describe the concept of Android SDK.
14. Explain the term ADT with different tools.
15. Explain AVD in detail.
16. Define the role of Emulator in Android application development.
17. Explain the importance of DVM with the help of diagram.
18. Differentiate between JVM and DVM.
installation.
19. Enist the system requirements for Android Studio
and SDK.
20. Explain how to configure Android studio