0% found this document useful (0 votes)
11 views10 pages

Practical 1_3

Download as pdf or txt
Download as pdf or txt
Download as pdf or txt
You are on page 1/ 10

Practical 1

1X. Practical related questions


1. List the different Android OS versions

2. State the features of Android OS


X. Exercise
1. Draw the architectural diagram of Android OS
Android operating system is a stack of software components which is roughly
divided into five sections and four main layers

Linux kernel

At the bottom of the layers is Linux - Linux 3.6. This provides a level of abstraction
between the device hardware and it contains all the essential hardware drivers like
camera, keypad, display etc. The kernel handles all the things that Linux is really
good at such as networking and a vast array of device drivers, which take the pain
out of interfacing to peripheral hardware.

Libraries

On top of Linux kernel there is a set of libraries including open-source Web browser
engine WebKit, well known library libc, SQLite database which is a useful repository
for storage and sharing of application data, libraries to play and record audio and
video, SSL libraries responsible for Internet security etc.

Android Libraries

This category encompasses those Java-based libraries that are specific to Android
development. Examples of libraries in this category include the application framework
libraries in addition to those that facilitate user interface building, graphics drawing
and database access. Some key core Android libraries available to the Android
developer are −
 android.app − Provides access to the application model and is the
cornerstone of all Android applications.
 android.content − Facilitates content access, publishing and messaging
between applications and application components.
 android.database − Used to access data published by content providers and
includes SQLite database management classes.
 android.opengl − A Java interface to the OpenGL ES 3D graphics rendering
API.
 android.os − Provides applications with access to standard operating system
services including messages, system services and inter-process
communication.
 android.text − Used to render and manipulate text on a device display.
 android.view − The fundamental building blocks of application user interfaces.
 android.widget − A rich collection of pre-built user interface components such
as buttons, labels, list views, layout managers, radio buttons etc.
 android.webkit − A set of classes intended to allow web-browsing capabilities
to be built into applications.

Android Runtime

This is the third section of the architecture and available on the second layer from the
bottom. This section provides a key component called Dalvik Virtual Machine which
is a kind of Java Virtual Machine specially designed and optimized for Android.
The Dalvik VM makes use of Linux core features like memory management and multi-
threading, which is intrinsic in the Java language. The Dalvik VM enables every
Android application to run in its own process, with its own instance of the Dalvik virtual
machine.
The Android runtime also provides a set of core libraries which enable Android
application developers to write Android applications using standard Java
programming language.

Application Framework

The Application Framework layer provides many higher-level services to applications


in the form of Java classes. Application developers are allowed to make use of these
services in their applications.
The Android framework includes the following key services −
 Activity Manager − Controls all aspects of the application lifecycle and activity
stack.
 Content Providers − Allows applications to publish and share data with other
applications.
 Resource Manager − Provides access to non-code embedded resources
such as strings, color settings and user interface layouts.
 Notifications Manager − Allows applications to display alerts and notifications
to the user.
 View System − An extensible set of views used to create application user
interfaces.

Applications

You will find all the Android application at the top layer. You will write your application
to be installed on this layer only. Examples of such applications are Contacts Books,
Browser, Games etc.

2. Differentiate between Windows OS and Android OS


User Interface
Both Android and Windows OS supports different interfaces
Android has a flat design and comes with a minimalistic look which attracts many
users toward it.
Android users can also add a widget to their home screen to enhance the look while
the Windows operating system is stuck with the same interface.
Windows OS allows users to resize the screen, flip them as well allows one to add or
remove them easily.
Apps
When it comes to apps Android is the best
Android is an open-source platform, so it has more applications and games than a
windows operating system.
Android OS comes with Google PlayStore, which has more than 2.2 million
applications and games which work with different versions of Android.
In windows the apps and games are much less in number and moreover most are
paid
Security
Android is an open-source platform, so for this reason, it is not more secure than the
Windows operating system.
In order to upload any apps, users need to go through strict security check-ups.
Devices
Android support a variety of devices as compared to windows
Practical 2
IX Practical related questions
1. List all the steps to install android studio
Download android studio(.exe/.zip)
Run the downloaded file. If zip, then extract and run. The welcome to android
studio set up window appears. Click “Next”
In the next prompt, it will ask for path for installation. Choose the path and
click next
The installation starts.
When the installation completes, the installation complete window appears.
Click next
Completing android studio setup window appears. Click finish
When finish is clicked. it will ask whether the previous settings needs to be
imported
Click do not import settings(default). Click on OK
Android studio starts and displays the welcome window. Click on next
Install type window is displayed. Select standard(Default). Click next
User can select the theme(light/dark). Light one is called IntelliJ and dark one
Dracula. Click on next.
It downloads the sdk.. click on Finish. It will start downloading the components
Click finish once download is completed.
Click start new android project

2. List various IDEs that can be used to execute Android OS

Android studio
Eclipse IDE
X. Exercise
1. Differentiate between JVM and DVM

2. What is IDE? Why java development toolkit is essential to install android OS?
IDE is a software application that provides facilities to computer programmers
to develop software
It consists of an editor, debugger, build automation tools and the environment
required
JDK is required a the source code can be java based. JDK is used to compile
java source code to .class files
Practical 3
IX Practical related questions
1. List basic requirements for configuring android OS
Windows requirements
Microsoft windows 7/8/10(32 bit /64 bit)
4 GB RAM minimum, 8 GB RAM recommended plus 1GB for emulator
2 GB of available disk space minimum. 4 GB recommended
2. Why byte code cannot run in Android
Java and android uses different environments
Android uses DVM. It is an interpreter only virtual machine that executes files
in .dex format(Dalvik executable format)
This is an optimized format for efficient memory and battery life for low
powered devices

X. Exercise
1. What is build type in gradle?
Build types define certain properties that Gradle uses when building and
packaging the app, and are typically configured for different stages of the
development lifecycle.
When a project is created, Android studio automatically creates the release
and the debug build types.
Debug is a build type that is used when the application is run directly from IDE
to device
A release is a build type that requires one to sign apk, it is meant to be
uploaded into play store
2. Explain the build process in Android

The Android build system compiles app resources and source code, and
packages them into APKs that can be tested, deployed, signed, and
distributed. Android Studio uses Gradle, an advanced build toolkit, to automate
and manage the build process, while allowing the developer to define flexible
custom build configurations. Each build configuration can define its own set of
code and resources, while reusing the parts common to all versions of the app.
The Android plugin for Gradle works with the build toolkit to provide processes
and configurable settings that are specific to building and testing Android
applications. The flexibility of the Android build system enables to perform
custom build configurations without modifying the app's core source files

The build process involves many tools and processes that convert the project
into an Android Application Package (APK) and is very flexible
1. The compilers convert the source code into DEX (Dalvik Executable) files,
which include the bytecode that runs on Android devices, and everything else
into compiled resources.
2. The APK Packager combines the DEX files and compiled resources into a
single APK. Before the app can be installed and deployed onto an Android
device, however, the APK must be signed.
3. The APK Packager signs the APK using either the debug or release keystore:
a. If app is a debug version, that is, an app intended only for testing and
profiling, the packager signs the app with the debug keystore. Android
Studio automatically configures new projects with a debug keystore.
b. If app is a release version that is intended to release externally, the
packager signs the app with the release keystore

4. Before generating the final APK, the packager uses the zipalign tool to
optimize the app to use less memory when running on a device.

You might also like