preface
The tech blog is finally back up to speed because I’ve finished the first draft of my advanced book, which I assume will be one of the more in-depth Android app books, a companion piece to The Art of Android Development (fingers cross). In the last chapter of this book I will analyze the Android underlying source code, but after all is an Android application development book, for the underlying source code reading can only take you into the door. Therefore, IN my blog, I will start a new series on system source code parsing, which starts with this article.
1.Android system architecture
Android system architecture is divided into five layers, from top to bottom are the application layer, application framework layer, system runtime layer, hardware abstraction layer and Linux kernel layer.
Application layer The applications built into the system as well as non-system level applications belong to the application layer. Responsible for direct interaction with users, usually developed in Java.
Application Framework layer (Java Framework) Application Framework layer for developers to provide the API required to develop applications, we usually develop applications are called this layer provided by the API, of course, also includes the system application. This layer is written in Java code and can be called the Java Framework. Let’s look at the major components that this layer provides.
The name of the | Functional description |
---|---|
Activity Manager | Manage the individual application lifecycle and the usual navigation fallback functionality |
Location Manager | Provide location and location function services |
Package Manager | Manage all applications installed on the Android system |
Notification Manager | Enables applications to display custom prompts in the status bar |
Resource Manager | Provides a variety of non-code resources used by the application, such as localized strings, images, layout files, color files, and so on |
Telephony Manager | Manage all mobile device functions |
Package Manager | Manage all applications installed on the Android system |
Window Manager | Manage all open window programs |
Content Providers | Enables data to be shared between different applications |
View System | Building the basic components of an application |
The Native system runtime layer is divided into two parts, namely C/C++ program library and Android runtime library. Here are some of them. C/C++ libraries can be used by different components of the Android system and provide services to developers through the application framework. The main C/C++ libraries are listed in Table 2 below.
The name of the | Functional description |
---|---|
OpenGL ES | 3D drawing function library |
Libc | Standard C system function library inherited from BSD, customized for embedded Linux-based devices |
Media Framework | Multimedia library, supporting a variety of common audio and video formats recording and playback. |
SQLite | A lightweight relational database engine |
SGL | The underlying 2D graphics rendering engine |
SSL | The secure socket Layer (SSL) is a security protocol that provides security and data integrity for network communication |
FreeType | A portable font engine that provides a unified interface to access files in multiple font formats |
2.Android Runtime library
Hardware Abstraction Layer (HAL)
The Linux kernel layer
2.Android system source directory
Androidxref.com/ to read the system source code. Of course,…
mirrors.tuna.tsinghua.edu.cn/help/AOSP/
Pan.baidu.com/s/1ngsZs,
The overall structure
Application layer
Apply the framework layer section
C/C++ library Part of the system runtime library layer (Native) C/C++ library types, powerful, C/C++ library is not completely in a directory, here gives several commonly used and more important C/C++ library directory location.
Directory location | describe |
---|---|
bionic/ | System C library developed by Google, open source under BSD license. |
/frameworks/av/media | System media library |
/frameworks/native/opengl | Third party graphics rendering library |
/frameworks/native/services/surfaceflinger | Graphics display library, mainly responsible for graphics rendering, superposition and drawing and other functions |
external/sqlite | C++ implementation of lightweight relational database SQLite |
As a system