Android is an open-source mobile operating system designed primarily for touchscreen mobile devices such as cell phones and tablets. It is a software stack based on modified versions of the Linux kernel (or kernel for short) and other open-source programs. There are many devices that are capable of making life easier, but Android is always one step ahead. The operating system was pioneered by a team that built it on top of the shoulders of giants right from its inception. Beyond what appears at the surface level on the Android OS, there are multiple layers that go into making up the Android operating system. Over the past few decades, these layers have been continually refined and improved through the use of custom code and open-source technologies. A number of companies have collaborated with each other and invested large sums of money and effort into the development of Android.
If you want to build a good foundation in Android development, your first step should be to understand the overall architecture of Android. To understand Android architecture, you should think of how the Android operating system is designed and constructed, how it is segmented into layers, and how it is built to function as a whole. In this article, we will explore the architecture of Android, which will help us better understand how Android components function as well as their relationship to each other.
First, let’s see what Android Architecture is.
An Android operating system for touchscreen devices poses a number of challenges that must be overcome when developing it. So, in a way, the architecture for an Android platform consists of a set of software components designed to support a large number of Android-enabled devices. This mobile operating system is based on a layered architecture of software stacks comprising a Linux kernel, a runtime environment, supporting libraries, an application framework, as well as a set of applications. As part of building such a complex system, careful structural attention must be paid to make sure all the Android Architect components do not conflict with each other. The Android architecture protects its many components from crashing altogether while keeping their independent functionalities intact. Some of the benefits of Android’s layered architecture can be summed up as follows:
To support the needs of every Android device, the Android architecture contains a different number of components than the iOS architecture. An Android system can be defined as a set of software stacks consisting of several components. It is important to note that among all the Android Architecture components, Linux Kernel, is responsible for providing the core operating system functions for smartphones, as well as DVM (Dalvik Virtual Machine), which acts as a platform for Android applications to run. The components that make up the android architecture are as follows:
Now let’s explore each of these in more detail:
As with any operating system, the Linux kernel, or whatever we call it in our context, is one of the most important components of Android’s architecture that resides at the root (bottom layer) of the entire system. It manages all the drivers needed during the runtime of an Android device, such as camera drivers, display drivers, audio drivers, Bluetooth drivers, and memory drivers, among others. Among the main features of the Linux kernel are as follows:
Android has evolved a great deal since it was first released and the Linux kernel it runs on has evolved with it too. Below is a table that details the different versions of the Linux kernel.
Android Version | Linux Kernel Version |
---|---|
1.5 Cupcake | (2.6.27) |
1.6 Donut | (2.6.29) |
2.0/1 Eclair | (2.6.29) |
2.2.x Froyo | (2.6.32) |
2.3.x Gingerbread | (2.6.35) |
3.x.x Honeycomb | (2.6.36) |
4.0.x Ice Cream San | (3.0.1) |
4.1.x Jelly Bean | (3.0.31) |
4.2.x Jelly Bean | (3.4.0) |
4.3 Jelly Bean | (3.4.39) |
4.4 Kit Kat | (3.10) |
5.x Lollipop | (3.16.1) |
6.0 Marshmallow | (3.18.10) |
7.0 Nougat | 3.18.48 4.4.0 |
7.1 Nougat | |
8.0 Oreo | 3.18.72 4.4.83 4.9.44 |
8.1 Oreo | 3.18.70 4.4.88 4.9.56 |
9.0 Pie | 4.4.146 4.9.118 4.14.61 |
10.0 Q | 4.9.191 4.14.142 4.19.71 |
Several native libraries are layered on top of the Linux kernel. The Library provides the device with a set of instructions that allow it to handle different types of data in an appropriate way. As part of Android development, native libraries are required, and most of these libraries are open-source. It is a collection of C/C++ core libraries as well as Java-based libraries, which support Android development, such as Graphics, Libc, SSL (Secure Socket Layer), SQLite, Media, Webkit, OpenGL (Open Graphic Library), Surface Manager, etc. Here are some details about some key Android libraries that are available for Android development.
The Android Runtime Environment is an integral part of Android. It contains components such as core libraries and the DVM (Dalvik Virtual Machine). The Android runtime, along with the libraries, powers our applications, and is the basis for the framework.
The application framework that stands on top of the native libraries and runtime layer provides us with Application Programming Interfaces (APIs) and higher-level services. The Android Application Framework provides classes, interfaces, and utilities that are used for the development of Android applications. Also included in this framework is an Android Hardware Abstraction Layer (HAL), which allows the application to communicate with hardware-specific device drivers and to manage both the UI and resources. The overall aim of it is to provide services through which we can create a particular class and make that particular class available for aid when creating applications. The Android framework includes the following high-level services that can be beneficial for developing mobile applications according to our prerequisites:
Among the layers of the Android architecture, applications are at the top. Applications that come pre-installed on the device, like contacts, music, app store, cameras, galleries, etc., as well as the ones downloaded from the Google Play Store, such as social applications, games, professional applications, etc., will be installed only on this layer. Applications run within Android’s runtime environment, utilizing the classes and services provided by the application framework. A typical Android user interacts with this layer mostly for basic functions like accessing the Web browser, making phone calls, viewing galleries, etc. Below are a few examples of some of the standard applications that come pre-installed on every device:
If you want to lay a good foundation for Android development, one of the first steps should be to get a basic understanding of its overall architecture. Android implementation is carried out by a software stack architecture that includes a Linux kernel, an application framework, libraries, a runtime environment, and a set of applications. Android Studio is a building environment that allows developers to build Android applications in Java or Kotlin and compile them down to bytecode. Upon installation of the application on a device, Android Runtime (ART) compiles the byte code to the native format required by the CPU so that the application can run on the device. A key feature of the Android architecture is its performance and efficiency, both in terms of the performance of applications as well as in the reusability of application design.
Throughout this article, we have detailed the Android architecture and its different layers, including the Linux kernel, corresponding libraries, Android runtime, application framework, and Android applications. Hopefully this article will help the reader navigate Android architecture without getting lost by making a few pointers along the way.