0% found this document useful (0 votes)
20 views

Unit-2_Installation and Configuration of Android

Uploaded by

raj373249
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
20 views

Unit-2_Installation and Configuration of Android

Uploaded by

raj373249
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 39

Unit 2

Installation and
Configuration of
Android
Android Operating System

 Android is an open-source mobile operating system. It is a variant of Linux hence providing


extensive security, modularity and productivity at the mobile device level.

 Originally, Android was created by a company called Android Inc. and later Google acquired
this company in 2005. After then, Google made it open source.

 Android is utilized not only in smartphones but also in tablets, netbooks, digital television
boxes, handheld game devices.
Running an Android Application
Running an Android Application

 There are different ways the programs run on various platforms.

 The lowest level software can be written in machine code that runs directly on the
microprocessor.

 Since it is difficult to develop complex applications in machine code, operating systems are
used.

 Operating systems provide a communication and control layer between the application
software and the hardware
Running an Android Application

Virtual Machine

 A native application for running on a specific hardware / operating system, we can do this
using a compiler and linker.

 Compiler and linker takes the source code and creates the executable file that actually runs
on the operating system.

 The main advantage of native applications is their speed. However, the disadvantage is the
incompatibility across different platforms.
Running an Android Application

Virtual Machine

 Virtual machine concept is developed to overcome this (platform dependency) limitation.


 Virtual machine is software that runs on the operating system and provides an abstraction to
the developer.
 The application software runs on top of the virtual machine.

 Therefore, as long as a computer has the virtual machine running, the


application software can run on that computer independent of the
hardware and the operating system.
Running an Android Application
The Java Virtual Machine (JVM) is a part of the Java Runtime Environment (JRE) that executes Java
Java Virtual Machine (JVM) bytecode. In mobile application development, JVM enables Java-based apps to run on different
platforms by translating platform-independent bytecode into machine-specific instructions.

 A good example of Virtual Machine (VM) is the Java Virtual Machine (JVM).
 JVM runs on almost all operating systems and platforms.
 Therefore, when we can develop Java software, it will be run on the JVM independent of the
operating system/platform.
 Advantage of developing apps that run on virtual machines can then be stated as,
Running an Android Application

Dalvik Virtual Machine (DVM) / Android Runtime (ART)

 Similar to Java applications, Android applications also run on a special JVM.


 There are two special virtual machines used in Android : Dalvik Virtual Machine (DVM) and
Android RunTime (ART).
 These are specialized JVMs which can run on low system resources.
Running an Android Application

Dalvik Virtual Machine (DVM) / Android Runtime (ART)

 DVM has been the default runtime environment (virtual machine) until the Lollipop release
(Android 5.0).
 ART is introduced by Android 4.0 and has been the default VM as of Android 5.0

 DVM and ART basically do the same job : running Android apps independent of the
platform.
 The main advantage of ART over DVM is the utilization of a concept called Ahead of Time
(AOT) compilation instead of Just in Time (JIT) approach.
Java Development Kit (JDK)

The Java Development Kit (JDK) contains:


 Tools, such as a compiler, profiler, and archive creator. These are used behind the scenes
during your build to create your application.

 Libraries containing APIs that you can call from your Kotlin or Java source code.

 The Java Virtual Machine (JVM), an interpreter that executes Java applications. You use the
JVM to run the Android Studio IDE and the Gradle build tool.
Android Software Development Kit (SDK)

 Android SDK is a collection of libraries and Software Development tools that are essential
for Developing Android Applications.

 These include a debugger, libraries, a handset emulator, documentation, sample code, and
tutorials.

 Android SDK is compatible with all operating systems such as Windows, Linux, MacOS, etc.
Android Developer Tools (ADT)

 The Android software development kit (SDK) includes many tools for developing Android apps.

 The tools can be generally categorized into two types,

1. SDK tools 2. Platform Tools


Android Developer Tools (ADT)

1. SDK tools
1. Android Tool:
This tool helps in managing the Android Virtual Device projects as well as the installed components of the
software development kit.

2. Emulator Tool:
It helps us in testing the applications without the need of using the application on an actual device.

3. Dalvik Debug Monitor Server(DDMS):


DDMS is very useful for debugging the Android Application.

4. Android Debug Bridge (ADB):


It is a very versatile command-line tool and is helpful for the communication between the developer and
the Emulator or the Android device that is connected.
Android Virtual Device (AVD)

 An Android Virtual Device (AVD) is a configuration that defines the characteristics of an Android
phone, tablet, Wear OS, Android TV, or Automotive OS device that you want to simulate in
the Android Emulator.

 The Device Manager is a tool, you can launch from Android Studio that helps you create and manage
AVDs.
Create Android Virtual Device (AVD)

To create a new AVD:

1. Open the Device Manager.

2. Click Create Device.

The Select Hardware window appears.

3. Select a hardware profile,


then click Next.
Create Android Virtual Device (AVD)

The System Image window


appears.

4. Select the system image


for a particular API level, and
then click Next.
Create Android Virtual Device (AVD)

The Verify
Configuration window
appears.

5. Change the AVD


properties as needed, and
then click Finish

The new AVD appears in


the Virtual tab of the
Device Manager and the
target device menu.
Create Android Virtual Device (AVD)

Create a hardware profile

 The Device Manager provides


predefined hardware profiles for
common devices so you can easily
add them to your AVD definitions.

 If you need to define a different


device, you can create a new
hardware profile.

*You can also edit existing


AVD and Existing hardware
profiles too.
Create Android Virtual Device (AVD)
AVD properties
AVD property Description
AVD Name Enter a name for the AVD. The name can contain uppercase or lowercase letters,
numbers, periods, underscores, parentheses, dashes, and spaces. The name of the file
storing the AVD configuration is derived from the AVD name.

AVD ID (Advanced) View the AVD ID. The AVD ID is derived from the AVD name. You can use the ID to
refer to the AVD from the command line.

Hardware Profile Click Change to select a different hardware profile from the Select Hardware window.

System Image Click Change to select a different system image from the System Image window. An
active internet connection is required to download a new image.

Startup orientation Select an option for the initial emulator orientation:


•Portrait: oriented taller than wide
•Landscape: oriented wider than tall
Create Android Virtual Device (AVD)
Hardware Profile properties
Hardware profile property Description
Device Name Enter a name for the hardware profile. The name can contain uppercase or lowercase
letters, numbers, periods, underscores, parentheses, and spaces. The name of the file
storing the hardware profile is derived from the hardware profile name.

Device Type Select one of the following:


•Phone/Tablet
•Wear OS
•Android TV
•Google TV
•ChromeOS Device
•Android Automotive
Screen: Screen Size Specify the physical size of the screen in inches, measured on the diagonal. If the size is
larger than your computer screen, it’s reduced in size at launch.

Screen: Screen Resolution Enter a width and height in pixels to specify the total number of pixels on the simulated
screen.
Screen: Round Select this option if the device has a round screen, such as some Wear OS devices.

Memory: RAM Enter the RAM size of the device and select the units, one of B (byte), KB (kilobyte), MB
(megabyte), GB (gigabyte), or TB (terabyte).
Emulators

 An Android emulator is a program that simulates an Android device on your


computer, allowing you to run, debug, test and develop Android apps
without a physical device

 The emulator helps the developer to run a trial product virtually without an
actual hardware device.

 An emulator is similar to a physical hardware mobile device including all the


features that an actual mobile contains.

 Emulator represents a specific Android device that can be used as a target


platform to run and test your android application on your PC.
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.

 The DVM was a software environment that translate Java code into a language that Android
devices could understand.

 It also manage memory usage, kept apps separate from each other, and ensured apps
worked well.
Dalvik Virtual Machine (DVM)

Compiling and Packaging Scheme

 As shown in Figure, 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.
Dalvik Virtual Machine (DVM)

Features of DVM
 Register-Based Architecture
 Optimized for Mobile Devices
 Dex Bytecode Execution
 Just In Time (JIT) Compilation
 Support for Multithreading
 DVM was slimmed down to use less space.
 An uncompressed .dex file is smaller in size as
compare to compressed .jar
 With using DVM, android device can run multiple
instances of VM efficiently.
Difference between DVM & JVM
Steps to Install & Configure Android Studio and SDK

Step 1:
 Go to Android https://developer.android.com/studio to get the Android Studio executable or zip
file.
Step 2:
 Click on the Download Android Studio Button.
 Click on the “I have read and agree with the above terms and conditions” checkbox followed
by the download button.
 Click on the Save file button in the appeared prompt box and the file will start downloading.
Step 3:
 After the downloading has finished, open the file from downloads and will prompt the
following dialog box.
 Click on next.
 In the next prompt, it’ll ask for a path for installation.
 Choose a path and hit next.
Step 4:
 It will start the installation, and once it is completed, it will be like the image shown below.
Step 5:
 Once “Finish” is clicked, it will ask whether the previous settings need to be imported [if the
android studio had been installed earlier], or not.
 It is better to choose the ‘Don’t import Settings option’. Click the OK button.
Step 6:
 This will start the Android Studio. Meanwhile, it will be finding the available SDK
components.
Step 7:
 After it has found the SDK components, it will redirect to the Welcome dialog box.
 Choose Standard and click on Next. Now choose the theme, whether the Light theme or the
Dark one.
 The light one is called the IntelliJ theme whereas the dark theme is called Dracula. Choose as
required. Click on the Next button.
Step 8:
 Now it is time to download the SDK components.
 Click on Finish. Components begin to download let it complete.
 The Android Studio has been successfully configured.
 Now it’s time to launch and build apps. Click on the Finish button to launch it.
Step 9:
 Click on Start a new Android Studio project to build a new app.
Thank You

You might also like