Let's discuss about Android architecture.
The Android system architecture is divided into five layers, as you can see in this diagram from top
to bottom.
First comes the application layer, which contains the system apps and the normal application, and
then comes the application framework layer or the Java API framework layer, which contains all these
managers, activity managers, location manager, package managers, etc. And then comes the system
runtime layer, which contains the Native C C++ libraries and the Android runtime, and after that,
the hardware abstraction layer or the hull, which contains the necessary logics for audio, Bluetooth,
camera sensor, etc. And at the bottom most we have the Linux kernel layer where we have the drivers
for audio, binder, display, iPad, Bluetooth, etc. and at the bottom we have the power management.
So these are the five layers of Android architecture.
Let's dig deeper into each of these components in the application layer, both the built in applications
and non system level applications exists.
They are basically responsible for direct interaction with the users and they are usually developed
in Java or Kotlin and these apps are mostly developed by the application developers.
And also there are the built in stock apps which comes as part of Aosp.
So we'll look at these system apps or the stock apps in a later session.
The application framework layer provides developers with the APIs needed to develop applications.
This layer is written in Java and it can be also called Java framework.
But nowadays there are some framework codes written in Kotlin as well.
We usually develop the applications, I mean the Android applications that can call the APIs provided
by this particular layer.
Let's look at the main components provided by the application layer.
So first we have the activity manager.
So activity manager is mainly responsible for managing the lifecycle of each application.
So each application is built with different activities or fragments.
So it is a responsibility of the activity manager to manage the life cycle of each application or each
activity within the application.
Next is the location manager.
The location manager provides the geographic location and positioning function services.
For example, the maps will be using the location manager to get the current location of the device.
Package Manager.
Package Manager manages all applications installed in the Android system.
It's basically responsible for installing and installing and giving permissions to the applications
installed in the Android system.
Notification Manager.
Notification Manager allows the application to display custom prompt information in the status bar.
So for example, when you get an email, for example, in the Gmail app, you get a message at the notification
that you have an email that is done through the notification manager and then comes the resource manager.
It provides various non code resources, the application users such as the localized strings, pictures,
layout files, color files, etc..
So if you are from an Android application development background, you definitely know, localize the
strings, pictures, layout files, color files, etc. which you use while developing the Android application.
So it is the responsibility of the resource manager to maintain it.
Then comes the telephony manager.
It manages all mobile device functions like the SIM management and the network management, etc. Then
comes the window manager.
Window manager manages all the open windows, so each activity is basically built with a window.
So we will learn more in more detail about Windows in a later session where we discuss about the Windows
management system.
Content providers and providers allow data to be shared between different applications within the system.
View System View System is responsible for building the essential view components of an application.
So it's basically responsible for inflating your layouts.
And these layouts has multiple types of views.
So the view system is basically responsible for rendering these different views onto the screen.
The system runtime library layer is divided into two parts the C C++ library and the Android runtime
library.
Let's discuss about them separately.
So let's first look at the C C++ library.
The C C++ library can be used by different Android system components and provide developers service
through the application framework.
So all the services which we use through the application are dependent on the C C++ library.
Below are some examples of C C++ libraries.
So the first one is OpenGL ES OpenGL for.
Embedded systems.
So this is basically a 3D drawing function library specifically designed for embedded devices.
Then we have the lipsey.
The lipsey is basically the standard C system function library inherited from BSD.
BSD stands for Berkeley Software Distribution, and this is basically customized for embedded Linux
based devices.
And then we have the media framework.
So this contains the library which supports recording and playback of various commonly used audio and
video formats like M.P. three, MP four, etc..
And then we have the SQLite.
This is a lightweight relational database engine.
This is again a lightweight solution created for mobile devices.
And then we have SDL still stands for Simple Graphics Library.
So this is the underlying UHD graphics rendering engine for Android.
And then we have SSL, this very common security protocol.
So the secure socket layer is a security protocol that provides security and data integrity for network
communication.
Then finally we have the free type.
This is basically to manage the different varieties of phones.
So this is basically a portable font engine.
It provides a unified interface to access a variety of font file formats.
So these are some of the major C C++ libraries found in Android System Runtime Layer.
The runtime library is divided into core library and ERP stands for Android runtime.
The core library provides most of the Java language core library functions so that developers can use
the Java language to write Android application.
So the purpose of core library is to simply provide Java language core library functions.
And now regarding the Dalvik virtual machine or Dalvik virtual machine can be compared with a Java virtual
machine, but the Dalvik virtual machine is specifically customized for mobile devices.
It allows multiple instances of virtual machine to run in the limited memory simultaneously, and each
Dalvik application is executed as an independent Linux process.
So since we have separate process, it prevents all programs from closing when the virtual machine crashes.
So that is the main advantage since we have different process.
Even if the virtual machine is virtual machine crashes, then it will prevent from all the apps or the
programs from being closed.
So the reason why Dalvik virtual machine was migrated to SRT is that it provides some advantages compared
to Dalvik virtual machine.
So under Dalvik the bytecode needs to be converted into machine code by a just in time compiler every
time the application is run.
So Dalvik basically used a just in time compiler.
So whenever the application runs, it has to convert the code into machine code.
This will slow down the running efficiency of the application because whenever the application starts
up, it has to be first converted into machine code and then run the app.
This will actually slow down the execution speed of the app with the introduction of error after Android
five, the code of all the application will be pre compiled in the machine code when it is first installed
in the device.
This makes the application a true local application.
In this way, R.T. makes the app secured faster compared to Dalvik.
Now let's look at the hardware abstraction layer.
The hardware abstraction layer is the interface between the operating system kernel and the hardware.
Its purpose is to abstract the hardware to protect the intellectual property rights of the hardware
manufacturers.
It hides the hardware interface, details of a specific platform and provides a virtual hardware platform
for the operating system so that it has hardware independence.
It can be transplanted on various platforms from the perspective of software and hardware testing,
both software and hardware testing can be completed based on the hardware abstraction layer, making
it possible to perform software and hardware testing in parallel.
So in layman's term, the purpose of hardware abstraction layer is to control the hardware.
So let's look at the Linux kernel layer, which is the outermost layer in Android.
Android's core system services are dependent on the Linux kernel and some Android specific drivers,
for example, audio display, keypad, Bluetooth, USB, etc. have been added on this basis.
The Android's System Security Memory Management Process Management Network Protocol Stack and driver
model depends on this Linux kernel, which makes Android in a way more secure and stable.
So that's about the Android architecture.
So understanding this five layer android are.
We'll help you when we analyze the system source code in the later tutorials.