Hierarchical Structure Analysis of Android source code

Source: Internet
Author: User

Bionic: the basic class library of the entire system. Android is developed based on this class library,

The Android system library is developed based on the bionic class library, including the tool Library (libcutils), log class library (liblog), and compression class library (libzipfile.

Main functions:

1. Complete Android initialization (init ).

Parse init. RC and start the program (parser. c) to be loaded during system initialization, initialize the device (devices. C), and enable the property service (property_service.c.

2. Start some basic services of the Android system.

1. System device service (vold ). For example, you can mount and unmount an SD card and receive events from the kernel to create device nodes.

3. shell program and corresponding toolbox.

4. ADB program.

5. logcat system.

It can be said that the items in the bionic and system files have completed Android's encapsulation of Linux. Based on these two folders, two core modules of the Android system are constructed: Dalvik and framework. Dalvik is a pure C-based Vm, which is described in detail on the Internet. Analyze the framework layer by layer.

The bottom layer is several modules:

1. utils tool Library (in the frameworks/base/libs/utils/directory)

This class library is compiled and written based on Bionic and provides high-level encapsulation for the basic C/C ++ class library in bionic. The C ++ program in the framework uses a large number of class libraries here to encapsulate higher-level system functions.

2. Binder Library (in the framewoks/base/libs/binder/directory)

Similar to openbinder open-source projects, this provides a process communication mechanism. This mechanism is widely used in the C ++ and Java layers. It divides communication parties into two roles: service provider and user. The provider has a registered service interface, and the user searches for the call.

3. UI Library (in the frameworks/base/libs/UI/directory)

This library mainly provides two types of interfaces: Ui rendering and video output. The output framework of the entire system is based on this library and communicates with framebuffer.

4. surfaceflinger Library (in the frameworks/base/libs/surfaceflinger/directory)

The higher level encapsulation of the UI Library provides output services for upper-layer modules in the Android system through the Binder Mechanism.

5. audioflinger Library (in the frameworks/base/libs/audioflinger/directory)

Audio output base class library. The upper-layer module uses this library to interact with the driver and output audio.

6. A large number of open-source libraries (under the external/directory)

These modules constitute the basis of the entire framework. Based on these modules, you can build a real Upper-layer module of the operating system and create an application program running environment. Typical examples include:

The multi-media off service provides audio and video playback and recording services.

A large number of service providers exist in the service management, maintenance, and management systems. applications access and use these services through the servicemanager of the Service Management Center through the Binder Mechanism, for example, power supply, Bluetooth, WiFi, and other modules are provided as services in the system for program calls.

Runtime Environment, initialize the runtime environment of the application, and load the first application, launcher.

After the environment is created when the application is running, the system is started. When an application is loaded into the system, the development API provided by the system is the most involved in the interaction with the system. It is mainly concentrated in the frameworks/base/CORE/directory.

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.