Android notes-Android architecture and android Architecture

Source: Internet
Author: User
Tags skia

Android notes-Android architecture and android Architecture
I. Android system architecture

The Android system architecture consists of four layers: Linux kernel layer, system library layer, application framework layer, and application layer.


Figure 1 architecture of the Android system (picture from the Network)

1. Linux Kernel layer (Linux Kernel)

  • This layer provides functions such as security, memory management, process management, network protocol stack, and driver model.

2. Libraries)

  • This layer includes two aspects: library written in C/C ++, Android Runtime
  • C/C ++ programming library
    • SQLite: Provides Database Support
    • OpenGL | ES: (Open Graphic Libraries for Embedded Systems) supports 3D plotting.
    • Free Type: font rendering engine
    • Webkit: Provides browser kernel support
    • SGL: (Skia Graphics Library) 2D Graphics Rendering Engine. Skia is an American company and was subsequently acquired by Google.
    • SSL: (Secure Sockets Layer) is a security protocol that guarantees Internet communication and data integrity.
    • Libc: (Bionic libc) C standard library, developed by Google and applied to embedded systems using BSD authorization terms
  • Android Runtime
    • Core Library: including Java API and Android API
    • Dalvik Virtual Machine: In limited memory, each Android application can have its own Dalvik Virtual Machine instance and run in an independent process (changed to the ART virtual machine after Android 5.0 ), independent processes can prevent all programs from being shut down when the Virtual Machine crashes.

3. Application Framework)

  • This layer mainly provides the framework required for application development so that programmers can perform rapid development.

4. Application Layer (Applications)

  • Applications installed on mobile phones belong to this layer.

5. Others

  • Developers
    • If you are engaged in Android Application Development, you should study the Android Application layer and application framework layer.
    • If you are engaged in Android system development, you should study the Android system library layer.
    • If you are engaged in Android driver development, you should study the Linux kernel layer of Android.
  • Dalvik Virtual Machine and ART (Android Runtime) Virtual Machine
    • After Android 5.0, the ART virtual machine replaces the Dalvik Virtual Machine to improve the smoothness of the Android system.
    • In the Dalvik virtual machine, every Time an application runs, the bytecode must be converted to the machine code through JIT (Just-in-Time instant compilation, this is why every time you start a program, it will be slow.
    • When the application is installed on the ART virtual machine, the bytecode is pre-compiled into the machine code, and no re-compilation is required when the application is running, the technology used is AOT (Ahead-of-Time pre-compilation)
    • The ART virtual machine also has disadvantages. Pre-compilation will occupy more memory space, and the installation time of applications will be extended.
  • Interface
    • Here we use a similar answer provided by zhihu.
    • For example, Mr. A searched A lot of high-quality beautiful pictures on the Internet through some technology and published them on his Weibo. He is also A fan of this field, so Xiao A's Weibo is an interface. Xiao B only needs to pay attention to Xiao A's Weibo to view A large number of beautiful pictures, without having to worry about the technology that Xiao A uses to obtain these images.
  • HAL (Hardware Abstraction Layer)
    • As shown in figure 2, this is a relatively new architecture of the Android system. There is also a Hardware Abstraction Layer called HAL (Hardware action Layer) in the figure)
    • HAL Origin
      • The release of the Linux kernel follows the GPL protocol, which stipulates that all modifications to the source code must be open-source.
      • If Google writes driver modules in the Linux kernel, the modified source code must be published, but this will damage the interests of hardware vendors. After all, if the source code is published, hardware Implementation Details and parameters are exposed. To solve this problem, Google proposed HAL. Vendors can implement hardware-related implementations in libraries (. so) format in HAL. Of course, the hardware driver cannot be completely out of the Linux kernel, so Google also made corresponding modifications in the Linux kernel, based on the GPL protocol, this part of the modified source code should be published, but because HAL does not belong to the Linux kernel modification, the source code here is not necessary to open source.
    • HAL Functions
      • HAL provides a standard interface for exposing hardware functions to the Application Framework layer.
      • HAL is composed of many library modules. Each library module implements a specific type of hardware component interface. Generally speaking, the corresponding hardware components can be called through the Library module, for example: the Bluetooth module has a specific Library module in HAL. When the Application Framework layer API accesses the bluetooth device, the Android system loads the corresponding library module for API use.
      • It is necessary to clarify here that the library module is the interface provided to the API, And the API is the interface provided to the programmer.

Figure 2 architecture of the Android system (picture from the Network)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.