preface

Android is huge, and everything we’ve learned is just the tip of the iceberg. I remember when I first got to know Android, I found that I didn’t know how to learn Android at all. I was very confused and confused. So here about the framework of the Android system, I hope to help beginners to understand the overall Android.

The body of the

Applications, Framework, Libraries, Hardware, Linux.

The Applications layer

This is the layer that app developers are most exposed to, and it is the applications that interact directly with users.

Application development using the Java language, this layer is a Java world by the majority of Java developers. The world is not completely independent; it relies on the Native world to function, but also on the framework layer as a cornerstone.

The main development tool is Android Studio, which is powerful and fun to use.

The Framework layer

This layer, written mostly in Java language, encapsulates many functions and provides a variety of apis for the Applications layer to meet business requirements. PMS,AMS,WMS, etc. are typically implemented in this layer.

When customizing functions or solving system bugs, it is necessary to edit the framework layer code. I prefer to use Vim to edit and then compile in the system environment.

Libraries layer

This layer mainly provides dynamic libraries, Android runtime libraries, Dalvik VIRTUAL machine, etc. Most of this layer is written in C or C++, so this layer can be simply regarded as the Native layer.

So library can be single compiled, and then pushed into the machine side for debugging.

The Hardware layer

The Hardware Abstract Layer (HAL for short) of Android system runs in user space. It shields the implementation details of Hardware driver modules downward and provides Hardware access services upward. Through the hardware abstraction layer, The Android system is divided into two layers to support hardware devices, one in User Space and the other in Kernel Space. In the traditional Linux system, hardware support is fully realized in the kernel space, that is, the hardware support is fully realized in the hardware driver module.

The reason Android controls hardware in two layers is to protect the interests of merchants. Because Linux is completely open source, the Linux part of the code needs to be made public, but details about the control logic of some Linux kernel drivers are also made public. Therefore, it is implemented through two layers, the first layer is located in the User space, dedicated to the hardware control logic, this layer is not public. And the other layer is implemented in the Linux kernel, this layer is just some simple read and write operations on the hardware, such as read and write the channel of the hardware register. This layer can be exposed.

Linux layer

Includes Linux kernel and some driver modules (such as LED driver, USB driver, wifi driver, etc.). This layer is mainly to deal with the hardware, the majority of the tuning driver.

When adding a driver or debug, you can compile the kernel separately and then burn it into the system separately.

conclusion

The above is a simple description of the Android system framework, a brief introduction to the various layers of roughly what to do. Therefore, if you are new to Android, you are advised to build your first app (Hello World) from the Applications layer. Because this layer has a relatively convenient tool AS, beginners only need to surf the Internet to roughly understand the installation of AS and project creation process, can create their own APP. Then slowly to learn Java syntax, you can quickly get started.

As for the other layers, they can be used as a follow-up ability improvement and further study downward.

The key is persistence and learning.

interactive

If the article has the wrong description, can leave a message directly, discuss together!

Articles that may be of interest

Android status bar height 0 is still displayed

Tread hole NavigationBar hidden or not

Android9.0 boot black screen for a while before loading the interface launcher solution

The last

I also write articles in wechat public number, update more timely, interested people can pay attention to the following public number!