Architecture Design and Analysis of the Android operating system
This article mainly introduces the architecture design and analysis of the Android operating system. The Android system architecture includes Linux kernel drivers, C/C ++ frameworks, Java frameworks, and Java applications, this article explains its functions separately. For more information, see
I have been working on the Android Application Layer for a long time. Recently I started to study Dongdong on the Android platform, mainly at the Android Frameworks layer and system library layer. The following is my understanding, understanding, and hope to share with you.
The Android system architecture includes Linux kernel drivers, C/C ++ frameworks, Java frameworks, and Java applications.
Android Application Layer:
Android applications must be supported by the Java framework. It is mainly for mobile phone users. The Android Application layer is written by Java code and runs on virtual machines. Virtual machines play an important role in the Android platform. When the virtual machine executes the Java class, if the Java class needs to communicate with the C/C ++ component, the virtual machine loads the C/C ++ component, then, let the Java function smoothly call the functions of the C/C ++ component. Java and C/C ++ can communicate with each other through the standard JNI interface.
Note: Java classes run on virtual machines, and C/C ++ does not run on virtual machines. So how do I load C/C ++ component functions?
The answer is: Through System. loadLibrary (*. so file name); The entry function is JNI_OnLoad ();
Frameworks framework layer (application framework layer ):
Java framework is encapsulated by C/C ++ library into a JNI. Java Native Interface (Java Local Interface. It serves as a bridge between the application layer and the system database layer. Mainly for mobile phone developers.
C/C ++ framework (System Library ):
Specifically implement the Java framework function. The native methods in the Java framework are all completed by C/C ++.
Underlying Android Driver (kernel layer ):
Finally, the driver hardware completes the function.
The system architecture diagram is as follows: