Android Architecture - Overview and Diagram | W3schools

Now, when we look at the structure of Android as an operating system, you would understand that it is a compilation of certain software components. All of these components are segregated into 5 sections and 4 major layers. To understand this architecture, you can take a look at the below-drawn block diagram.

Also Read: Android Environment Setup

By looking at the above architectural diagram, you will get to know that the 4 main layers are:
* Linux Kernel Layer
* Native Layer
* Application Framework Layer
* Applications Layer

Linux Kernel

Here, we will begin with the bottom layer which is Linux Kernel Layer. To be exact, this is Linux 3.6 along with almost 115 patches. This layer is responsible for creating an abstraction between various hardware devices. Linux Kernel Layer is also responsible for containing all the important and necessary peripheral devices which include a monitor, camera, keyboard, and many others. Other than that, the kernel is highly capable of handling various networks and device drivers. Device drivers take care of easing out the interfacing issues of all the hardware devices.


Native Layer

The native layer consists of libraries and android runtime. This layer resides just above the Linux Kernel Layer.

This libraries section contains several software components which include surface manager, media framework (responsible to record and play various mode of media like audio and video), SQLite (a repository for storing and sharing the application data), SGL, SSL (handles the Internet Security), and a few others. It also consists of software components like open source web browser engine WebKit and libc.

Android Libraries
Android libraries consist of those Java-based libraries which are associated with the development of Android. The components which fall under Android libraries are application framework libraries. Along with these, it is also composed of libraries which enables access to a database, creation of user interface, and graphics drawing. Below are a few but very important Android libraries that an Android developer can use for the Android development.

Android Libraries Function of Android Library * Provision of the Android application model
* Acts as a cornerstone for all the Android applications
android.content * Responsible for providing access to the application content
* Lets application publish the content
* Exchanges message between applications and its components
android.database * Contains SQLite
* Content provider’s data can be accessed via this library
android.opengl * Java-based interface
* Responsible for 3D graphics drawing
android.os * Provision of standard operating system services – communication through messages, system services, and communication between processes
android.text * Displays and modifies text on a monitor
android.view * Acts as a fundamental building block of Android application graphical user interfaces
android.widget * Already built interface components – buttons, drop-down lists, labels, and many others
android.webkit * Collection of classes
* Allows integration of application with web-browsing capabilities


Besides Java-based libraries, it is a home to C/C++ based libraries too. These C/C++ based libraries reside in the Android software stack.

Android Runtime
This is the second section of the Native Layer. This section contains two important software components which are core libraries and Dalvik Virtual Machine (DVM). Before proceeding ahead, you must know that Dalvik Virtual Machine is similar to Java Virtual Machine (JVM) but is specifically designed for the Android application development. This Android Virtual Machine depends on key features of Linux which include multi-threading and memory management. Both of these concepts are also a very important part of Java programming language. With the help of DVM, Android application can run and execute in its own process. This has become possible by the use of DVM instance. Other than Dalvik Virtual Machine, core libraries are also a component of Android Runtime. These core libraries enable Android application developers to develop an Android application on Java platform with ease and simplicity.

Application Framework
This is the third layer in the Android architectural diagram. Application Framework Layer resides just above the Native Layer. This layer provides Java classes which in return helps in providing several high-level services to the Android applications. All of these high-level services are available for the use of Android developers.


Below are the services provided by the Application Framework Layer:

Services by Application Framework Where to opt for these services?
Activity Manager * When you want to control various phases of an application lifecycle
* When you want to keep an activity stack of an application
Content Providers * When you want an application to publish and share data with the help of other applications
Resource Manager * When you want to embed non-code resources in an application. Examples of non-code embedded resources are color settings, interface tools, and strings
Notifications Manager * When you want an application to notify the user regarding any of your service(s)
View System * When you want an extended view in a user interface for specific users

Applications Layer is the topmost layer in the Android architecture. This layer consists of all the Android applications. The installation of any of the developed Android applications will be done on this topmost layer only. A few of the examples of Android applications are an alarm, camera, calendar, contacts, dialer, browser, and many others.