1.Android platform architecture

Android is an open source software stack based on Linux, created for a wide range of devices and models. The main components of the Android platform are shown below.

  • Application(System Application Layer -System Apps)

Android comes with a core set of apps for email, messaging, calendar, Internet browsing and contacts. Apps that come with the platform have no special status, just like apps that users can choose to install. So third-party apps can become users’ default web browser, SMS Messenger, and even their default keyboard (with some exceptions, such as the system’s Settings app). System applications are available to users’ applications and provide major functions that developers can access from their own applications. For example, if your application wants to send SMS messages, you don’t need to build the feature yourself, you can instead call your installed SMS application to send messages’ to the recipient you specify

  • Application Framework -Java API Framework

You can use the entire feature set of Android OS through apis written in the Java language. These apis form the building blocks needed to create Android applications. They simplify the reuse of core modular system components and services, including the following:

  • A rich, extensible view system that can be used to build an application’s UI, including lists, grids, text boxes, buttons and even an embeddable Web browser
  • Resource manager for accessing non-code resources, such as localized strings, graphics, and layout files
  • Notifications manager, which allows all applications to display custom alerts in the status bar
  • The Activity manager, which manages the application lifecycle, provides common navigation-back stack content providers that allow applications to access data in other applications (such as the Contacts app) or share their own data
  • Libraries and Android Runtime

Native C/C++ library

  • The system library includes nine subsystems, namely Layer Management, media library, SQLite, OpenGLEState, FreeType, WebKit, SGL, SSL and LIBC.

2. Android Runtime

  • For devices running Android 5.0 (API level 21) or higher, each application runs in its own process and has its own Android Runtime (ART) instance. ART is written to run multiple virtual machines on low-memory devices by executing DEX files, a bytecode format designed for Android that is optimized to use very little memory. A compilation tool chain (such as Jack) compiles Java source code into DEX bytecode, making it available to run on the Android platform.
  • Some of the main functions of ART include:
  • AOT and JUST-in-time (JIT) compilation
  • Optimized garbage Collection (GC)
  • Better debugging support, including dedicated sampling analysers, detailed diagnostic exception and crash reports, and the ability to set up monitoring points to monitor specific fields prior to Android version 5.0 (API level 21). Dalvik is the Android Runtime. If your application works well on ART, it should also work on Dalvik, but not the other way around. Android also includes a set of core runtime libraries that provide most of the functionality of the Java programming language used by the Java API framework, including some Java 8 language functionality.
  • HAL(Hardware Abstraction Layer)

The Hardware Abstraction Layer (HAL) provides a standard interface that exposes device hardware functionality to a higher-level Java API framework. HAL contains multiple library modules, each of which implements an interface for a specific type of hardware component, such as a camera or Bluetooth module. When the framework API requires access to device hardware, the Android system loads library modules for that hardware component.

  • The kernel

The Android platform is based on the Linux kernel. For example, The Android Runtime (ART) relies on the Linux kernel to perform low-level functions, such as threading and low-level memory management. Using the Linux kernel allows Android to take advantage of major security features and allows device manufacturers to develop hardware drivers for well-known kernels.