Let's take a quick look at the architecture of the entire Android system. From the diagram below, we can see that this architecture is divided into several different tiers, and the bottom layer serves the previous tier.
Linux Kernel
The Android system is built on a solid cornerstone: the Linux kernel. Linus Torvalds created it in 1991. Linux provides the hardware abstraction layer for Android, allowing Android to
It is easy to install on a variety of platforms.
In essence, Linux provides Android with memory management, process management, network services, and other system-level services.
As an Android developer, you don't have direct access to Linux kernel-level stuff, but you'd better understand that.
Native libaraies (local library)
The previous layer of the Linux kernel is the local library of Android, which are written in C or C + +. They are compiled for specific hardware architectures and are preinstalled on mobile phones by handset vendors.
Some important libraries:
Surface Manager Interface Manager
Android uses a combination of window management mechanisms, your program drawing instructions are not directly on the screen buffer, but first drawn as a non-display bitmap, and then with other bitmaps on the screen,
Last displayed to the user. This allows the system to do some interesting window changes.
2d and 3D plotting
• Audio and video decoding
Android can play videos, record videos in some formats, such as ACC AVC MP3 MPEG-4
SQL database
Android itself contains a lightweight database: SQLite.
Firefox and Apple phones are also used in this database.
Your program can permanently save some data to your phone via the database.
• Browser engine
To quickly display the contents of the HTML description, Android uses the WebKit library, which also uses the same library as Google Chrome, Apple Safari.
These libraries are not a complete application in themselves, they are intended to provide support for the upper-level applications. If you are interested, you can use the NDK to write your own local library.
Android Runtime Runtime
On top of the Linux kernel are Android Runtime, which includes a special virtual machine Dalvik, as well as a Java core library. Dalvik is a virtual machine written by Google specifically for Android, and your application is compiled
are converted to platform-independent bytecode files, and then, when the program runs, Dalvik interprets and executes these bytecode directives. Although this bytecode format differs from the normal Java bytecode format, Dalvik is essentially a Java virtual machine. It's just that it has less memory requirements. Also, the Android system can run multiple virtual machines for multiple programs at the same time, and they are isolated.
There are 2 important differences between Dalvik and traditional Java virtual machines:
1. Dalvik is running the. dex suffix file. During compilation, Traditional. class files are converted to. dex files, and. dex files are more compact and efficient than traditional. class files. This is done considering mobile devices such as mobile phones with limited
Power and memory.
2. The Java core Library and traditional Java EE javame libraries in the Android runtime layer are not identical.
Application Framework Application Frameworks
The next level is the application framework. This layer provides a high-level development module. Make it easy for you to develop applications. They were preloaded into the Android system.
The following hands are some important parts.
Activity Manager:
It controls the life cycle of the application and maintains a fallback stack that is common to the program.
content providers:
Encapsulates information that is shared between applications. such as contact person.
Resource Manager:
Resource Manager, managing non-code sections.
Location Manager:
Regional Manager: No matter where your Android phone is, it knows where your friends are.
Notification Manager:
Message Manager: Used to notify a number of message events, such as new information, alarms, and so on.
Application and widgets applications and controls
The application application occupies the entire screen to interact with the user, while the widget (control) occupies only a small rectangular area.
"Translated" Android system architecture