Learn about the Android stack and how different layers of software come together to make Android applications.
Android runs on billions of devices around the world. Let’s learn a little bit more about the operating system that makes all of this possible. The Android operating system is actually a stack composed of five different layers—five individual software elements. Each has its own role to play and unique ways that developers can directly or indirectly interact with them.
It’s helpful to think of the layers of the stack as building blocks. Each one builds on the one below it adding more and more functionality until you end up with an Android phone.
Certain layers of the stack are abstracted away from developers. This means that Android developers are not meant to interact with these layers of the stack directly. These are written and maintained by Google employees and contributors in the open-source community. Other layers of the stack, however, are used directly by Android developers—including us as we develop Android applications in this course!
The layers of the stack in order are:
- Java API framework
- Libraries and Android Runtime
- Hardware abstraction layer (HAL)
- Linux kernel
While it’s not necessary to understand each layer in its entirety, having an appreciation for what they all do is a great way to increase your knowledge as an Android developer and ultimately help you to write better, more optimized code.
- Apps are programs that run on Android and are composed of one or more interactive screens.
- System apps are replaceable apps the system has recognized as the default apps to perform common tasks like email, texting, camera stuff, etc.
- The Java API Framework is a set of software libraries and utilities developers leverage to build out their apps.
- The Android Runtime as an isolated container where each app lives and carries out its processes.
- The hardware abstraction layer (HAL) consists of a number of library modules that manage access to the hardware of an Android device like the camera, audio, Bluetooth, etc.
- The Linux kernel is the lowest layer of the stack and manages all the core operations of the operating system.