You are on page 1of 6

ANDROID APPLICATION DEVELOPMENT

UNIT 2

2. Describe Android architecture framework:


2.1 Linux Kernel
2.2 Libraries
2.3 Android Runtime
2.4 Application Framework
2.5 Applications
2.6 Android Startup and Zygote
2.7 Android Debug bridge
2.8 Android Permission model
2.9 Android Manifest File

Android Architecture
Android architecture or Android software stack is categorized into five parts:

● linux kernel
● native libraries (middleware),
● Android Runtime
● Application Framework
● Applications
1. Linux kernel
It is the heart of android architecture that exists at the root of android architecture. Linux kernel is
responsible for device drivers, power management, memory management, device management and
resource access.

2. Native Libraries
On the top of linux kernel, their are Native libraries such as WebKit, OpenGL, FreeType, SQLite,
Media, C runtime library (libc) etc.

The WebKit library is responsible for browser support, SQLite is for database, FreeType for font
support, Media for playing and recording audio and video formats.

3. Android Runtime
In android runtime, there are core libraries and DVM (Dalvik Virtual Machine) which is
responsible to run android application. DVM is like JVM but it is optimized for mobile devices. It
consumes less memory and provides fast performance.

4. Android Framework
On the top of Native libraries and android runtime, there is android framework. Android
framework includes Android API's such as UI (User Interface), telephony, resources, locations,
Content Providers (data) and package managers. It provides a lot of classes and interfaces for
android application development.

5. Applications
On the top of android framework, there are applications. All applications such as home, contact,
settings, games, browsers are using android framework that uses android runtime and libraries.
Android runtime and native libraries are using linux kernal.

ANDROID STARTUP AND ZYGOTE


● Power on and system startup
● When we switch on our android mobile, Boot ROM code starts its execution from a
pre-specified location which is hardwired on Reading Only Memory. It loads
Bootloader into Random Access Memory and starts execution.
● Bootloader: The bootloader is one type of small program. An Android operating
system run after bootloader process. The bootloader is the first process to run. There
are many popular bootloaders are available. The manufacturer can use readymade
bootloaders like redboot, uboot etc or they can develop own bootloaders. The
bootloader is not a part of an android operating system.
● There are two stages of bootloader,
○ Bootloader detects external Random Access Memory (RAM) and loads a
program which will be helpful in the second stage.
○ Bootloader setup network, memory etc. which requires running kernel.
● Location of bootloader: <AndroidSource>\bootable\bootloader\legacy\usbloader
● Kernal
● Linux kernel starting process and android kernel starting the process are similar. This
process will setup cache, protected memory, scheduling, and loads drivers. When
kernel completed the system setup it looks for “init” in the system files and launches
startup process or first process of the system.
● Init process
● This is the first process, or in other words, it is a boss of all processes. There is two
responsibility of init process.
● mount directories like /sys, /dev, /proc
● run init.rc script.
● Location of init process: <android source>/system/core/init
● Location of init.rc file: <android source>/system/core/rootdir/init.rc
● Zygote and Dalvik Virtual Machine
● We know that in java there is Java Virtual Machine (JVM), but in the android virtual
machine must be run as fast as possible. Suppose you have three apps running
simultaneously, and it needs three Dalvik virtual machines, but it consumes lots of
memory and time. As a solution to this problem, android has a facility named Zygote.
The Zygote enables code sharing across the Dalvik Virtual Machine. The zygote is a
process wich starts at the time of system boot. Zygote preloads and initializes core
library classes.
● Zygote loading process:
● Load ZygoteInit class,
● registerZygoteSocket() – It registers a server socket for zygote command connections.
● preloadClasses() – Is a simple text file that contains a list of classes that need to be
preloaded, you can find the file at <android source>/framework/base
● preloadResources() – Everything that is included in the android.R file will be loaded
with this method (themes and layouts).
● At this time, boot animation will be displayed.
● System Services
● Starting Power Manager
● Creating Activity Manager
● Starting Telephony Registry
● Starting Package Manager
● Set Activity Manager Service as System Process
● Starting Context Manager
● Starting System Context Providers
● Starting Battery Service
● Starting Alarm Manager
● Starting Sensor Service
● Starting Window Manager
● Starting Bluetooth Service
● Starting Mount Service
● Other Services:
● Starting Status Bar Service
● Starting Hardware Service
● Starting NetStat Service
● Starting Connectivity Service
● Starting Notification Manager
● Starting DeviceStorageMonitor Service
● Starting Location Manager
● Starting Search Service
● Starting Clipboard Service
● Starting Checkin Service
● Starting Wallpaper Service
● Starting Audio Service
● Starting HeadsetObserver
● Starting AdbSettingsObserver

Android Debug Bridge (adb)


● Android Debug Bridge (adb) is a versatile command-line tool that lets you communicate with a
device. The adb command facilitates a variety of device actions, such as installing and debugging
apps, and it provides access to a Unix shell that you can use to run a variety of commands on a
device. It is a client-server program that includes three components:
● A client, which sends commands. The client runs on your development machine. You can invoke
a client from a command-line terminal by issuing an adb command.
● A daemon (adbd), which runs commands on a device. The daemon runs as a background process
on each device.
● A server, which manages communication between the client and the daemon. The server runs as
a background process on your development machine.
● adb is included in the Android SDK Platform-Tools package. You can download this package
with the SDK Manager, which installs it at android_sdk/platform-tools/. Or if you want the
standalone Android SDK Platform-Tools package

Android Permission Model


● Android contains a permission system and predefined permissions surely tasks. Each
application will request needed permissions. For instrance, an application may declare that
it needs network access. It also can outline new permissions.
● System permissions have totally different levels, e.g., protection levels.
● The permission concept thought has modified since API 23. Before API level 23 the user
was asked throughout installation, Once API level the user is asked throughout run time.
● An Android application declares the specified permissions in its Android manifest. It also
will define additional permissions that it can use to limit access to sure components
● The two most significant protection levels are normal and dangerous permissions:
○ Normal permissions are permissions that are deemed harmless for the users privacy or the
operation of other applications. For instance, the permission to set the time zone. Normal
permission are automatically granted to the application. See Normal permissions for a
complete list.
○ Dangerous permissions affect the users private information,affect his data of other
application. For example, the able to read the users contact data. Dangerous permissions
must be granted by the user at run time to the app.

You might also like