Android Architecture
Before starting Android application development it is important to know about the Android platform architecture. This will give a
basic idea about the
overall Android operating system and its internal modules arrangement.
Architecture Overview:
The overall architecture of Android OS is divided into different five layers and six sections. Each layer contains the stack of software
components
which are required at various stage. Its graphical representation can be shown as below:
*Image Inspiration: https://developer.android.com/guide/platform
Let's look into detail of each layer and section of the architecture:
- Linux Kernel
Starting from the bottom first layer is the Linux Kernel layer. The whole Android platform was founded on the top of the Linux kernel. Linux kernel provides
various advantages to the Android platform like enhanced security features, effective task management, multithreading, memory management, etc. - Hardware Abstraction layer(HAL)
On the top of Linux Kernel comes the Hardware Abstraction Layer(HAL) which provides the interface and made it possible for the API framework to interact
with the actual hardware and sensors and fetch data from them. HAL contains various library modules for different types of hardware like audio controller
chip, Bluetooth/WiFi chip, camera sensors, GSM modules, touch display sensors, GPS sensors, etc. - Android Runtime
Next comes Android Runtime(ART) which is in the same layer of Libraries. The main functionality of the Android runtime is task handling, process handling,
multi-threading and memory management. And to achieve this, it makes use of the core functionality of the Linux Kernel. In Android, each application runs
on its own process and has its own separate instance of Android Runtime. In the earlier Android versions(before API 21) the Dalvik Virtual Machine(DVM) was
used. DVM was like a java virtual machine(JVM) specially designed for the mobile Operating System like Android which enables each Android apps to run in a
separate process with their own instance of DVM. But now Google flagged DVM as deprecated and provided ART to manage this functionality to improve
application performance and optimize battery usage. - Native C/C++ Libraries
The next layer contains the libraries for the native C/C++. These libraries are used by most of the components and services whose execution dependencies are
based on C/C++ libraries. These are libraries are exposed to the application by the Java APIs framework. Examples of such libraries are Open GL ES (used for
managing 2D and 3D graphics display), Media Framework (for managing codecs using in encoding and decoding of various media file types), WebKit (used in web
browsing), and many more. - Java API Framework
Java API framework is the set of various APIs or function written in Java through which entire features of the Android OS is exposed to the application layer of the
architecture. In simple words, we can say that using this framework all the apps access the system components and services of the Android OS. These APIs will act
as the building blocks when we will write the apps for the android platform. Examples of some of the components and services accessed through the Java API
framework are:- View System, used for creating app UI and various UI component like grids, layouts, list, button, text-boxes etc.
- Content Provider, Used fetch data from other apps or for data sharing.
- Notification Manager, Display and manage the alerts in the top notification bar
- Activity manager, Manages the lifecycle of the apps
- System Apps
These are the core apps that come with stock Android OS have some basic features. Examples of these apps are Phone dialler, contact book, SMS messenger app,
web browser, etc. Apart from these system apps, there are various other designed by the developer targeting specific needs.