The Android system architecture is divided into four layers, from top to bottom:

  • Applications
  • Application Framework
  • Libraris and Android Runtime
  • Linux Kernel



1. [k? : n]

The user controls the Android device through these applications, which are represented by a small icon on the device that the user clicks to execute. The Android system generally has built-in applications with functions such as Email, SMS, browser, and contacts. Usually developers are at this level.

2. Application Framework

Application Framework is actually the Android API (Application Programming Interface, Application Programming Interface), provides a variety of Application development API for rapid development, Hidden behind each application is a set of services and systems, mostly written in Java, including:

  • View System: Rich and extensible Views that you can use to build applications, including lists, grids, text boxes, buttons, and even embeddable Web browsers.
  • Activity Manager: Manages the Activity lifecycle and provides a browsing backtrace stack that allows users to return to the previous page by pressing the Back button.
  • Content Providers: Enable applications to share data with each other.
  • Resource Manager: Provides access to non-code resources, such as local strings, graphics, and layout files.
  • Notification Manager: Displays specified information in the status bar to notify or remind users.

3. Android Runtime

The Android Runtime can be divided into Android Core Libraries (Android Core Libraries) and Dalvik Virtual Machine (Dalvik VM).

  • Android Core Libraries: The Android Core function Libraries provide most of the same functions as the Oracle Java Core function Libraries.
  • Dalvik Virtual Machine: Each Android application runs in its own process and has a separate Dalvik Virtual Machine instance. Dalvik is designed to run multiple virtual systems simultaneously and efficiently with a single device. Dalvik executable file for the Dalvik VIRTUAL machine execution (.dex), which is optimized for small memory usage. Meanwhile, the VIRTUAL machine is registrie-based. All classes are compiled into class files by the JAVA compiler, and then converted into. Dex format by the VIRTUAL machine through the “dx” tool in the SDK.

4. Libraris

Android has an internal library of functions written primarily in C/C++. Android Application developers do not use this library directly, but through the higher level of the Application Framework to use this library, so some people call this type of function library Native Libraries.

  • Bionic System C library – a standard C system function library (LIBC) inherited from BSD that is customized for Embedded Linux-based devices.
  • Media Framework – This library enables Android to play and record audio and video files. The library supports playback and recording of a variety of commonly used audio and video formats, as well as static image files. Encoding formats include MPEG4, H.264, MP3, AAC, AMR, JPG, PNG.
  • Surface Manager – Manages graphical operations and displays of 2D and 3D layers.
  • Webkit,LibWebCore – the built-in browser for Android. Webkit is the same engine as Chrome and Safari.
  • SGL – Specializes in 2D graphics for Android.
  • 3D Libraries – Based on OpenGL ES 1.0 APIs; The library can use hardware 3D acceleration (if available) or highly optimized 3D soft acceleration.
  • FreeType – Bitmap and vector font display.
  • SQLite – a powerful lightweight relational database engine.
  • OpenGL ES – 3D graphics library suitable for embedded systems.
  • Another part that is not shown above is the hardware abstraction layer. In fact, Android does not require all device drivers to be in the Linux kernel, but implemented in userSpace, the main reason for this is the GPL, Linux is distributed under this protocol, which means any changes to the Linux kernel

5. The Linux Kernel

Android takes Linux as the core of the entire operating system. Linux provides the main system services for Android, such as security management, memory management, process management, network protocol stack and driver model. The Linux kernel also acts as an abstraction layer between hardware and software stacks. It has also been partially modified, mainly involving two parts:

  • OpenGL ES – Mainly to save power, after all, handheld devices, low power is what we are looking for.
  • Binder (IPC) – Provides efficient interprocess communication. Although the Linux kernel already provides this functionality, many Android services require it, and for some reason it has implemented its own set of features.