Android Architecture - Software Stack of Android
In the previous tutorial, you learnt what is Android, different versions of Android and what features it supports. Now that you have basic understanding and knowledge about Android, in this tutorial, we will study about Android Software Stack (see the diagram below) which will help you to understand how Android works inside a device.
The Android operating system follows a layered architecture approach. All these layers are responsible for different roles and features that we have discussed below.
This layer is the foundation of the Android Platform.
- Contains all low level drivers for various hardware components support.
- Android Runtime relies on Linux Kernel for core system services like,
- Memory, process management, threading etc.
- Network stack
- Driver model
- Security and more.
Hardware Abstraction Layer (HAL)
- Provides Abstraction between hardware and rest of the software stack.
Android Runtime (ART)
- Designed to run apps in a constrained environment that has limited muscle power in terms of battery, processing and memory.
- Since Android 5.0, each app runs in its own process within its own instance of ART virtual machine, which makes process management more crucial.
- ART uses
DEX files, which is a type of bytecode, specially designed for Android, which helps ART to manage memory more efficiently.
- Contains set of core libraries that enables developers to write Android Apps using Java Programming.
- Prior to Android 5.0, Dalvik was used as Android runtime.
- ART is capable of both Ahead-of-time (AOT) and Just-in-time (JIT) compilation.
- It also has a very efficient garbage collection.
- Exposed to developers through Android Application Framework.
- Contains C/C++ libraries used by components of Android Systems.
- Few features include,
- SQLite Library used for data storage and light in terms of mobile memory footprints and task execution.
- WebKit Library mainly provides Web Browsing engine and a lot more related features.
- The surface manager library is responsible for rendering windows and drawing surfaces of various apps on the screen.
- The media framework library provides media codecs for audio and video.
- The OpenGl (Open Graphics Library) and SGL(Scalable Graphics Library) are the graphics libraries for 3D and 2D rendering, respectively.
- The FreeType Library is used for rendering fonts.
- It is a collection of APIs written in Java, which gives developers access to the complete feature set of Android OS.
- Developers have full access to the same framework APIs used by the core applications, so that they can enhance more in terms of functionalities of their application.
- Enables and simplify the reuse of core components and services, like:
- Activity Manager: Manages the Lifecycle of apps & provide common navigation back stack.
- Window Manager: Manages windows and drawing surfaces, and is an abstraction of the surface manager library.
- Content Providers: Enables application to access data from other applications or to share their own data i.e it provides mechanism to exchange data among apps.
- View System: Contains User Interface building blocks used to build an application's UI, including lists, grids, texts, boxes, buttons,etc. and also performs the event management of UI elements(explained in later tutorials).
- Package Manager: Manages various kinds of information related to the application packages that are currently installed on the device.
- Telephony Manager: Enables app to use phone capabilities of the device.
- Resource Manager: Provides access to non-code resources (localized Strings, bitmaps, Graphics and Layouts).
- Location Manager: Deals with location awareness capabilities.
- Notification Manager: Enable apps to display custom alerts in the status bar.
- Top of the Android Application Stack, is occupied by the System apps and tonnes of other Apps that users can download from Android's Official Play Store, also known as Google Play Store.
- A set of Core applications are pre-packed in the handset like Email Client, SMS Program, Calendar, Maps, Browser, Contacts and few more.
- This layer uses all the layers below it for proper functioning of these mobile apps.
So as we can see and understand, Android holds layered or we can say grouped functionalities as software stack that makes Android work very fluently in any device.
Android Devices in Market
A device that runs Android OS comes in all shapes and sizes. Various devices that run Android OS and Apps are as follows,
- E-reader Devices
- MP4 Players
- Internet TVs and more.
In August 2008, around an year after acquiring Android, Google announced Android Application Market - an online application store for Android Devices. This online store was later on named, Play Store and was made available to the users in October 2008, allowing users to directly download any third party application into their devices. Both paid and free applications are available on the Play Store.