Android Platform


Android Platform Architecture

Android is an open source, Linux-based software stack created for a wide array of devices and form factors. The architecture of the android OS contains the following major components which makes up the complete Android system:
1.     Linux Kernel
2.     Hardware Abstraction Layer
3.     Android Runtime
4.     Native C/C++
5.     Java API Framework
6.     System Apps

Linux Kernel
It is the foundation of the Android Platform. The Android Runtime relies on the Linux kernel for underlying functionalities such as threading and low-level memory management. Linux kernel allows Android to take advantage of key security features and allows device manufacturers to develop hardware drivers for a well-known kernel.
Hardware Abstract Layer
This layer provides the higher level Java API framework with standard interfaces that exposes device hardware capabilities. It consists of multiple library modules which implements a specific interface for the hardware components, such as the camera and Bluetooth module. Whenever a framework API makes a call to access devices hardware then the system loads the stored library modules for the specific hardware component.
Android Runtime
Android Runtime (ART) is the application runtime environment used by the Android OS. The devices which are running on android version 5.0 (API level 21) or higher, every applications runs in its own process and with its own instance of ART. It is written to run multiple virtual machines on low-memory devices by executing DEX files, a bytecode format designed especially for Android which is optimized for the minimal memory footprint. Some major features of ART are:
·        Ahead-of-time (AOT) and just-in-time (JIT)
·        Optimized garbage collection (GC)
·        Better debugging which includes sampling of profilers, detailed diagnostic exceptions and reports for the crash
·        Ability to set watch points to monitor specific fields
It also includes a set of core runtime libraries which helps in providing the Java programming language with most of the functionality.
Native C/C++ Libraries
Most of the Android OS components, such as ART and HAL require native libraries which are written in C and C++. The Android platform provides Java API framework to expose the functionality of some of these native libraries for various apps.
We can also make the use of Android NDK to access these native platform libraries to directly access the native codes if we are trying to develop a App requiring C or C++ code
Java API Framework
The APIs written in the JAVA language contains all the features set of the Android OS. These API form the building block we need to create Android apps by simplifying the reuse of core, modular system services and components, which include the following:
·        Extensible View System you can use to build an app’s UI, which includes lists, grids, text boxes, buttons and even a web browser
·        Resource manager which provides access to non-code resources such as graphics and layout files
·        Notification manager to display custom applications alerts in the status bar
·        Content Providers which allows the apps to access the data form the other apps, such as the contacts or even to share their own data
System Applications
Android comes with a set of core apps for email, SMS messaging, calendars, internet browsing, contacts, and more. Apps included with the platform have no special status among the apps the user chooses to install. So a third-party app can become the user's default web browser, SMS messenger, or even the default. The system apps function both as apps for users and to provide key capabilities that developers can access from their own app.

Android Applications

Android applications are usually developed in the Java language using the Android Software Development Kit. Once developed, Android applications can be packaged easily and sold out either through a store such as Google Play, SlideME, Opera Mobile Store, Mobango, F-droid and the Amazon Appstore. 
Android powers hundreds of millions mobile devices in more than 190 countries around the world. It's the largest installed base of any mobile platform and growing fast. Every day more than 1 million new Android devices are activated worldwide.  This tutorial has been written with an aim to teach you how to develop and package Android application. We will start from environment setup for Android applications programming and then drill down to look into various aspects of Android applications.