Android Architecture Explained

Brian Kitunda
3 min readMar 19, 2023

Android is the world’s leading mobile operating system. It is open source and open for extension. Mobile vendors extend stock Android to come up with a ‘custom’ Android implementation. That implementation is referred to as a ROM. Xiaomi has MIUI as it’s implementation of Android, while Samsung has OneUI. Anyone can create a custom ROM — I am currently working on one. I have had to go through the architecture of Android in the process. This is what I will be sharing today.

Android Architecture Diagram

1. Applications

On top of the model, we have 3 types of applications namely:

  • Android Applications
  • Privileged Applications
  • Device Manufacturer Applications

Android Applications

These are apps that are created solely using the Android API. You will find them in the Play Store or any other application stores. These apps can be preinstalled on the system by the device manufacturer.

A good example is social media applications like Twitter, Tiktok or any other applications created by application developers.

Privileged Applications

These are apps that are preinstalled on the system such as the clock application. They are built using a combination of the System API and Android API.

Device Manufacturer Applications

These are apps that are added to the system by device manufacturers. Xiaomi for instance might decide to add their Fitness app to the system. These apps are created using the Android API and the System API and must be preinstalled on the system.

2. APIS

The second layer from the top has 2 APIs namely:

  • System API
  • Android API

System API

These are Android APIs that are only available to partners and OEMs(Original Equipment Manufactures).

These APIs are used in creation of both Privileged Applications and Device Manufacturer Applications.

Android API

This is the publicly available API for third party Android application developers. Third party applications such as Whatsapp are built on top of these APIs.

3. Android Framework

This is a group of Java classes, interfaces and other precompiled code upon which apps are built.

Part of the framework is publicly exposed using the Android API. The 2 APIs listed above are basically gateways to the Android Framework.

4. System Services

These help in accessing the underlying hardware. Functionality exposed by the Android Framework communicates with the system services to access the underlying hardware.

An example would be the notification service that is responsible for sending app notifications.

5. Android Runtime(ART)

Every Android device runs on a certain processor. My current device, a Xiaomi Redmi 8 runs on Qualcomm Snapdragon processor. My previous device which was a Tecno Phantom 6 ran on Mediatek processor. There is a difference in how these 2 processors will execute requests.

During runtime, the bytecode from the upper stages is converted into processor specific instructions that are executed by the device runtime environment.

6. Hardware Abstraction Layer(HAL)

On an Android device, there are several hardware components e.g fingerprint, camera, radio, usb, wifi and bluetooth. For all these hardware components there are different vendors.

This layer provides an abstraction with standard interfaces for hardware vendors to implement. This way Android developers do not have to worry about lower level driver implementations.

7. Native daemons and libraries

Daemons are services that run in the background in the android system. Examples include init, healthd, logd, and storaged.

Native libraries on the other hand are libraries that contain native code that is code that has been compiled for a specific hardware architecture. Examples include libc, liblog, libutils, libbinder, and libselinux

8. Kernel

It facilitates interaction between software and hardware components.

--

--