Hello folks! This is my first post in the tutorials category and from the title you might have already guessed we will talking about Android architecture today. Well, to understand any operating system its very important to understand the architecture. I know most of you might not really understand what exactly does a “operating system architecture” mean. So let me simplify the term. Architecture is basically a design, design flow of how the machine works in order to perform any operation. What you see on screen is just the upper layer of this architecture. Any action you perform on this layer goes through some set of layers and in the end interacts with the hardware of the machine commanding it perform the action(requested by you).

So enough of simplifications let’s get to the topic now.Android was created for small machines. So designers had to keep in mind that they would be working with limited resources yet will have to replicate the operations performed on big machines

Android Architecture can be classified into four layers

Linux Kernel

Libraries+Android Runtime

Application Framework

Applications

Linux Kernel

This is the at the bottom of the Android architecture .Let us first understand what exactly is a Kernel.Kernel is central module of a OS. It is responsible for memory management,process management, and disk management. Basically it connects the system hardware to the application software

So even Android needs a kernel and instead of writing its own they choose Linux. Why? Because Linux is open source, Google’s Android developers could modify the Linux kernel to fit their needs. Linux gives the Android developers a pre-built, already maintained operating system kernel to start with. This is the way many different devices are built — for example, the PlayStation 4 uses the open-source FreeBSD kernel, while the Xbox One uses the Windows NT kernel found in modern versions of Windows.

HAL(Hardware Abstraction Layer)

The hardware abstraction layer (HAL) defines a standard interface for hardware vendors to implement and allows Android to be agnostic about lower-level driver implementations. The HAL allows you to implement functionality without affecting or modifying the higher level system. HAL implementations are packaged into modules ( .so ) file and loaded by the Android system at the appropriate time.

Libraries

On the top of Linux Kernel we have a set of libraries These libraries are used to enable various features in the Android OS.All these are written in C++. I am listing some of these libraries with its function.

SQLite It is used to access data published by content providers and includes SQLite database management classes SSL It is used to provide internet security OpenGL It is used to provide Java interface to the OpenGL/ES 3D graphics rendering API. Media framework It is used to provides different media codecs which allow the recording and playback of different media formats WebKit It is the browser engine used to display internet content or HTML content

Within this layer comes the most important part of Android Architecture-Android Runtime

Android Runtime basically has two components

Dalvik Virtual Machine

Core Libraries

Dalvik Virtual Machine

Well I consider this as the most important part of Android OS architecture. This is what makes Android ->”ANDROID”:p . Let me explain, actually everything above this level of the architecture is written in Java. So basically we will have a set of .class files. Running those .class files on a small mobile processor is what becomes a problem. Dalvik Virtual machine converts these .class files into .dex files which would make processing much faster.These files run with minimum memory footprint .Hence you can have multiple instances of this VM running i.e. Multitasking. Dalvik Virtual Machine is similar to JVM but only difference is that it is designed and optimized for Android.

Core Libraries

These are a set of libraries written in Java to provide APIs for Android development

Android Application Framework

This basically the environment in which your application runs. This layer provides high level APIs for your android application enabling them to implement custom features. I have listed some components below

Activity Manager – Controls all aspects of the application life cycle and activity stack.

– Controls all aspects of the application life cycle and activity stack. Content Providers – Allows applications to publish and share data with other applications.

Resource Manager – Provides access to non-code embedded resources such as strings, color settings and user interface layouts.

– Provides access to non-code embedded resources such as strings, color settings and user interface layouts. Notifications Manager – Allows applications to display alerts and notifications to the user.

– Allows applications to display alerts and notifications to the user. View System – An extensible set of views used to create application user interfaces.

– An extensible set of views used to create application user interfaces. Package Manager – The system by which applications are able to find out information about other applications currently installed on the device.

– The system by which applications are able to find out information about other applications currently installed on the device. Telephony Manager – Provides information to the application about the telephony services available on the device such as status and subscriber information.

– Provides information to the application about the telephony services available on the device such as status and subscriber information. Location Manager – Provides access to the location services allowing an application to receive updates about location changes.

Applications

This contains all the application that you see on your device. This includes system based apps like Contacts, Calender etc and all the applications you have installed from the Google plastore.All these are developed with the help of APIs from core libraries and Android framework

Now that you have understood the Android architcture click here to read about the four important components of Android.