There are main layers of Android’s architecture.
- Linux Kernel
- Application Framework
- Native Libraries
- Runtime Environment
Applications: The applications that users directly engage with make up the top layer of the Android system. These could be pre-installed system programs (such as Contacts, Phone, and Browser) or independent programs that you download from the Google Play Store or other places. The APIs offered by the application framework are used in Android applications that are created in Java or Kotlin.
Linux Kernel: The Linux kernel includes all of the low-level device drivers, including those for audio, Wi-Fi, flash memory, Bluetooth, cameras, keypads, and other devices. Additionally, it is the Android’s abstract layer.
Application Framework: The APIs (Application Programming Interfaces) offered by the Android application framework are extensive, enabling programmers to create applications on top of the Android platform. It consists of elements like Activity Manager (manages application lifecycle), Content Providers (manages data exchange between applications), Resource Manager (manages application resources), and Notification Manager (manages system notifications). The framework uses an architectural design pattern called Model-View-Controller (MVC), in which activities stand in for the View, services for the Controller, and data models for the Model.
Here are some important components of the Android application framework:
- Activity: Android’s single screen is called an activity. It is comparable to a Java window or frame. You can arrange all of your user interface (UI) elements or widgets on one screen with the use of an activity.
- Fragment: A fragment is a sub-activity. A single activity can contain more than one fragment. Inside a single activity, fragments represent multiple screens.
- Service: it is a component that can perform long-running operations in the background without direct interaction with the user, such as handling network transactions, playing music, etc.
- Content Provider: Access to a main data repository is controlled by a content provider. A provider is a component of an Android application, which frequently offers a unique user interface for handling the data. However, other applications predominantly use content providers, and they do so by utilizing a provider client object to visit the provider. In the SQLite database, your application may keep video and audio files in addition to structured entries. All of this information is accessible through a content provider.
- Broadcast receiver: The Android system has a dormant component called a broadcast receiver. It cannot operate without an Intent. If a specified event occurs, the Broadcast Receiver has to transmit a notification to the user.
Applications can sign up for an event using a broadcast receiver. The system will alert all of the registered applications as soon as the event takes place.
Native Libraries: The Linux kernel is stacked with several native libraries. The device receives a set of instructions from the library that enable proper handling of various data kinds. Native libraries are needed for Android development, and the majority of these libraries are open-source. It is a set of Java-based and C/C++ core libraries that support Android development, including Graphics, SSL, SQLite, Media, Web kit, OpenGL, Surface Manager, etc.
Runtime Environment: The Android operating system uses the runtime environment to execute applications. This is a replacement for the older “Dalvik” virtual machine, which was included with the Android operating system up until Android 4.4 (KitKat).