Decoding Android Architecture from Linux Kernel to System Apps

Decoding Android Architecture from Linux Kernel to System Apps

Android is an open-source, Linux Kernel-based software stack having a collection of several C/C++ libraries. Among all these components, Linux Kernel provides the main functionality of the Operating System to our device.

The Android software stack


🐧 Linux Kernel

Linux Kernel is the foundation of the Android Platform. Every subsequent layer depends on the Linux Kernel in some sort or another. For Example, Android Runtime(ART) relies on Linux Kernel for threading and memory management.
It manages all the drivers and acts as an abstraction layer between the device hardware and the other components of Android architecture.

  • Security: handles the security between the application and the system.

  • Memory Management

  • Process Management: allocates resources to processes whenever they need them.

  • Network Stack: It effectively handles network communication.

  • Driver Model: manages all the available drivers such as display drivers, camera drivers, Bluetooth drivers, audio drivers, memory drivers, etc. which are required during the runtime.


⚙️ Hardware Abstraction Layer (HAL)

Hardware Abstraction Layer acts as a medium for high-level Java API Framework to communicate with our device hardware. Whenever a Framework API calls for device hardware, the particular library module from the HAL is loaded by the Android System.


✅ Android Runtime

It provides the base for the application framework and powers our application with the help of the core libraries. The Core Libraries enable us to implement Android applications using the standard JAVA or Kotlin programming languages.

Each app runs in own instance of ART. ART runs multiple virtual machines by executing Dalvik Executable Format Files(DEX). DEX is a byte-code format designed for the Android platform.


🗂️ Native C/C++ Libraries

ART and HAL, are built from native code that requires native libraries written in C and C++. The Android platform provides Java framework APIs to expose the functionality of some of these native libraries to apps.

For example, you can access OpenGL ES through the Android framework’s Java OpenGL API to add support for drawing and manipulating 2D and 3D graphics in your app. Web-Kit provides all the functionality to display web content and to simplify page loading.


🖇️ Java API Framework

The entire feature set of the Android OS is available to us through APIs written in the Java language. It provides the services with the help of which we can create a particular class and make that class helpful for the Application creation.

It includes different types of services activity manager, notification manager, view system, package manager etc. which are helpful for the development of our application


📱 System Apps

Applications is the top layer of Android architecture. The pre-installed applications like home, contacts, camera, gallery etc and third-party applications downloaded from the Play Store like chat applications, games etc. will be installed on this layer only.
It runs within the ART with the help of the classes and services provided by the application framework.