Practical 1_3
Practical 1_3
Practical 1_3
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
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.
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.