Android Architecture

Sithara Rao
4 min readJan 26, 2021

Before diving into designing and developing an application, it is important to understand the architecture of Android platform. Here is a blog to make you understand the layers in Android.

Android

Android is a Linux based, open source software stack created for working on many devices and configurations.

Let us understand the software stack that includes major components in an Android system.

Source: https://developer.android.com/guide/platform

As per the above diagram, Android stack is categorized into below layers:

  1. Linux Kernel
  2. Hardware Abstraction Layer [HAL]
  3. Native C/C++ Libraries [Middleware] & Android Runtime [ART]
  4. Application Framework
  5. System Applications

Let us now understand every layer in-depth:

Linux Kernel:

Kernel is always the main component that provides life to an Operating System. The sole responsibility of a kernel is to manage

  1. Memory
  2. Power
  3. Drivers
  4. Resources

It behaves as an abstraction between the Hardware layer and the remaining stack

Hi All! This is me in a nutshell, says the Kernel

Hardware Abstraction Layer [HAL]:

HAL is a middle-man who exposes the hardware capabilities present in the Kernel to the Application Framework. The framework cannot access all the hardware properties of the devices directly because the components used by the application can modify it. So, there has to be a mediator who provides the functionality of the requested property. HAL does it right away.

Policeman-job is what your HAL does for unauthorized requests!
Device drivers functionality request
Yay! Permission granted!

Native C/C++ Libraries:

The core components, services are coded in C/C++ and are included as a part of native library to help in providing the functionalities to the Android application. Few of them are listed below:

Webkit: Open source web browser engine that displays the web content

Media Framework: To provide support for playing and recording the audio and video.

Open GL ES: Used for graphics

Open MAX AL: Codec Software

LibC: C Runtime library

SQLite: For database operations

Surface manager: Displays the contents

Android Runtime:

For devices running Android version 5.0 (API level 21) or higher, each app runs in its own process and with its own instance of the Android Runtime (ART). ART is written to run multiple virtual machines on low-memory devices by executing DEX files, a bytecode format designed specially for Android that’s optimized for minimal memory footprint.

The core libraries present in the ART will enable us to implement android applications using standard JAVA programming language.

Every app has its own instance of ART

Application Framework:

Android architecture has provided API’s [Application Programming Interface] to access the features available in Android OS.

If we need to access any of the “core functionalities” in Android, it is exposed through API’s. Few of the feature set are listed below:

View System: Android provides enriched set of UI materials for easier and simpler implementation.

Resource Manager: This provides access to non-coded resources such as localized strings, drawables, layout files etc.,

Notification Manager: Provides alerts and enables the app to display it in the status bar.

Activity Manager: Manages the lifecycle of the application and helps in maintaining the back-stack.

Content Providers: Enables the application to access the data apart from their own application and to share it [Example: Contacts]

Application Layer and System Apps:

This belongs to the top layer that is visible to the user.

All the application that we use, be it a System app[Pre-installed apps such as Contacts, Camera, Settings etc.,] or the ones downloaded from Play Store will be working on the application layer with their own ART. All the app in the device uses the Application framework to run and execute their functionality.

Overview of pre-installed apps

This is all about the Android Platform Architecture. Stay tuned for updates! 🙋🏻

--

--