DEV Community

Cover image for How Android actually works under the hood
Pedro Bustamante
Pedro Bustamante

Posted on

How Android actually works under the hood

Most people think Android is just apps and UI.

But underneath every screen, gesture, or notification…

there’s an entire layered system working together.

And the more I learn about Android internals, the more I appreciate how much is happening behind the scenes.


Android is built in layers

One thing I noticed while learning about Android’s internals is that the architecture is often represented differently depending on where you look.

Sometimes you’ll see:

  • 4 layers
  • 5 layers
  • or even more detailed variations

And honestly, all of them can be correct.

Some diagrams group certain components together, while others separate them to explain things more clearly.

But the general idea stays the same:

Android is a layered system where each layer has a specific responsibility.


1. Linux Kernel

At the very bottom, Android is powered by the Linux Kernel.

This layer is responsible for low-level system operations like:

  • Memory management
  • Process management
  • Security
  • Device drivers

This is what allows Android to communicate with hardware like:

  • Cameras
  • Bluetooth
  • Wi-Fi
  • Audio
  • Sensors

Without this layer, Android wouldn’t be able to interact with the physical device at all.


2. Hardware Abstraction Layer (HAL)

Above the kernel, Android uses something called the Hardware Abstraction Layer (HAL).

This layer acts like a bridge between the hardware and the higher-level Android system.

Instead of every component needing to know how specific hardware works internally:

Android talks to standardized interfaces.

That’s one of the reasons Android can run on so many different devices from different manufacturers.


3. Native Libraries & Android Runtime (ART)

This is where things start becoming more familiar for developers.

Android includes many native libraries written in C/C++, such as:

  • SQLite
  • OpenGL
  • Media libraries
  • Web rendering components

Alongside that, Android also includes ART (Android Runtime).

This is what runs Android applications.

Kotlin and Java code eventually become bytecode that ART can execute efficiently on the device.

This layer is also responsible for things like:

  • Memory optimization
  • Garbage collection
  • App execution

4. Application Framework

This is the layer most Android developers interact with every day.

The framework provides the high-level APIs used to build Android apps.

Things like:

  • Activity Manager
  • Window Manager
  • Notifications
  • Resources
  • Lifecycle handling

This layer abstracts a huge amount of complexity and gives developers a more structured way to interact with the system.


5. Applications

At the top, we finally have the apps themselves.

This includes:

  • System apps
  • Third-party apps
  • Android launchers
  • Mobile applications built with Kotlin, Java, XML, or Jetpack Compose

Even though modern UI development changed a lot over time, the idea remains the same:

apps interact with the framework, which interacts with lower layers underneath.


One thing I found really interesting

What surprised me the most while learning about Android’s architecture is how layered everything really is.

From the UI we touch…

all the way down to the Linux kernel managing hardware interactions.

Android feels simple on the surface because an enormous amount of complexity is hidden underneath.

And honestly, understanding those layers gives you a completely different appreciation for how the system works.


Final thought

The more I learn about Android internals, the more I realize modern mobile systems are less “magic” than they seem.

They are carefully layered systems where every part has a responsibility.

And understanding those responsibilities…

helps you better understand the platform as a whole.

Top comments (0)