The first time to see my article friends, you can follow, like, forward, every day to share a variety of dry technology and program ape fun
directory
- 1. Intuitive architecture diagram
- 2. Detailed architecture
- 2.1, the Linux Kernel
- 2.1, the Android Runtime
- 2.3, Libraries,
- 2.4, Application Framework
- 2.5, Applications
- 3, summarize
1. Intuitive architecture diagram
The following chart shows the main components of the Android system:
It can be clearly seen that the Android system architecture consists of five parts: Linux Kernel, Android Runtime, Libraries, Application Framework, and Applications. Part 2 will cover these five sections in detail.
2. Detailed architecture
Now let’s take the scalpel and dissect the parts. In fact, this part of the SDK documentation has done a good job for us, what we need to do is to take the doctrine, and then add their own understanding. Now analyze the layers from the bottom up.
2.1, the Linux Kernel
Android provides core system services based on Linux 2.6, such as security, memory management, process management, network stack, and driver model. The Linux Kernel also acts as an abstraction layer between hardware and software, hiding specific hardware details and providing uniform services for the upper layer.
If you have studied computer networking and know OSI/RM, you will know that the benefit of layering is to use the services provided by the lower layer to provide uniform services for the upper layer, shielding the differences between the lower layer and the lower layer, so that changes at this layer and the lower layer will not affect the upper layer. In other words, each layer plays its own role, and each layer provides fixed Service Access Point (SAP). The professional Point can be said to be high cohesion and low coupling.
If you’re just doing application development, you don’t need to know much about the Linux Kernel.
2.2, the Android Runtime
Android contains a collection of core libraries that provide most of the functionality available in the Java programming language core class library. Each Android application is an instance in the Dalvik virtual Machine, running in its own process. The Dalvik VIRTUAL machine is designed to run multiple virtual machines efficiently on a single device. The executable file format of the Dalvik VM is. Dex. Dex is a compression format specially designed for Dalvik, suitable for systems with limited memory and processor speed.
While most virtual machines, including JVMS, are stack-based, the Dalvik vm is register-based. Both architectures have their advantages and disadvantages. Generally speaking, stack-based machines require more instructions, while register-based machines require larger instructions. Dx is a set of tools for converting java.class to.dex format. A dex file usually has multiple. Classes. Because dex sometimes has to be optimized, it increases the file size 1-4 times, ending in ODEX.
The Dalvik VIRTUAL machine relies on the Linux kernel to provide basic functions such as threading and low-level memory management.
2.3, Libraries,
Android contains a collection of C/C++ libraries that are used by various components of the Android system. These capabilities are exposed to developers through Android’s Application Framework. Some core libraries are listed below:
- System C Library – BSD derivative of the standard C System Library (LIBC), adapted to be based on embedded Linux devices
- Media library — Based on PacketVideo’s OpenCORE. These libraries support playback and recording of many popular audio and video formats, as well as still image files, including MPEG4, H.264, MP3, AAC, AMR, JPG, PNG
- Interface management – Manages access to display subsystems and 2d and 3D graphics layers that seamlessly combine multiple applications
- LibWebCore – a new Web browser engine that drives the Android browser and embedded Web views
- SGL – Basic 2D graphics engine
- 3D library – Based on the implementation of OpenGL ES 1.0 APIs Libraries use hardware 3D acceleration or contain highly optimized 3D software raster
- FreeType – Bitmap and vector font rendering
- SQLite – a powerful and lightweight relational database engine that all applications can use
2.4, Application Framework
By providing an open development platform, Android enables developers to create extremely rich and innovative applications. Developers are free to take advantage of the device’s hardware, access location information, run background services, set alarms, add notifications to the status bar, and much more.
Developers have full access to the framework APIs used by the core application. The application architecture is designed to simplify the reuse of components so that any application can publish its functionality and any other application can use it (subject to security restrictions imposed by the framework). This mechanism allows users to replace components.
All applications are really a set of services and systems, including:
- Views — a rich, extensible collection of views that can be used to build an application. This includes lists, grids, text boxes, buttons, and even embedded Web browsers
- Content Providers – Enable applications to access data from other applications, such as contacts, or to share their own data
- Resource Manager – Provides access to non-code resources such as localized strings, graphics, and layout files
- Notification Manager – Enables all applications to display custom alerts in the status bar
- Activity Manager – Manages the application life cycle and provides generic navigation rollback capabilities
2.5, Applications
Android comes with a core set of applications, including email clients, SMS applications, calendars, maps, browsers, contacts, and other Settings. All applications are written in the Java programming language. Richer applications are waiting to be developed!
3, summarize
From the above we know that the Android architecture is layered, very clear, with a clear division of labor. Android itself is a Software Stack, or “Software Stack architecture,” which is divided into three layers: the operating system, middleware, and applications. From the above we also see the power of open source, a familiar open source software here to contribute their own strength.