The android application development framework is Application Framework. Its system architecture consists of 5 parts, namely: Linux Kernel, Android Runtime, Libraries, Application Framework, and Applications. The second part will introduce these 5 parts in detail. Let’s analyze each layer from bottom to top. Android architecture 1. Linux KernelAndroid provides core system services based on Linux 2.6, such as: security, memory management, process management, network stack, and driver model. Linux Kernel also serves as an abstraction layer between hardware and software. It hides specific hardware details and provides unified services to the upper layer. If you have studied computer networking and know OSI/RM, you will know that the advantage of layering is to use the services provided by the lower layer to provide unified services to the upper layer, shielding the differences between this layer and the lower layers. When this layer and the lower layers change, It will not affect the upper levels. In other words, each layer performs its own duties, and each layer provides a fixed SAP (Service Access Point). The professional point can be said to be high cohesion and low coupling. If you are just doing application development, you don't need to understand the Linux Kernel layer in depth. 2. Android Runtime Android contains a collection of core libraries that provide most of the functions available in the core class library of the Java programming language. Each Android application is an instance of the Dalvik virtual machine and runs in their own process. The Dalvik virtual machine is designed to efficiently run multiple virtual machines on a single device. The Dalvik virtual machine executable file format is .dex. The dex format is a compression format specially designed for Dalvik and is suitable for systems with limited memory and processor speed. Most virtual machines, including JVM, are stack-based, while the Dalvik virtual machine is register-based. Both architectures have their pros and cons. Generally speaking, stack-based machines require more instructions, while register-based machines require larger instructions. dx is a set of tools that can convert Java .class to .dex format. A dex file usually has multiple .classes. Since dex must sometimes be optimized, the file size will increase by 1-4 times, ending with ODEX. The Dalvik virtual machine relies on the Linux kernel to provide basic functions such as threads and low-level memory management. 3. LibrariesAndroid contains a collection of C/C libraries for use by various components of the Android system. These features are exposed to developers through the Android application framework. Some of the core libraries are listed below: System C library - BSD derivative of the standard C system library (libc), adapted for embedded Linux-based devices Media library - OpenCORE based on PacketVideo. 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 - Manage access to display subsystems and seamlessly combine multiple The application's 2D and 3D graphics layer LibWebCore - a new web browser engine that drives the Android browser and embedded web views SGL - a basic 2D graphics engine 3D library - based on the implementation of OpenGL ES 1.0 APIs.
The library uses hardware 3D acceleration or contains highly optimized 3D software raster FreeType - bitmap and vector font rendering SQLite - a powerful and lightweight relational database engine that can be used by all applications 4. Application Framework provides open development by Platform, Android enables developers to create extremely rich and innovative applications. Developers are free to take advantage of device 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 core applications. The application's architecture is designed to simplify the reuse of components; any application can publish its functionality and any other application can use those functionality (subject to the security restrictions enforced by the framework). This mechanism allows users to replace components. All applications are actually a set of services and systems, including: View - a rich, extensible collection of views that can be used to build an application. Including lists, grids, text boxes, buttons, and even embedded web browser content providers (Content Providers) - allowing applications to access data from other applications (such as address books), or * share Own data resource manager (Resource Manager) - provides access to non-code resources such as localized strings, graphics and layout files Notification Manager (Notification Manager) - enables all applications to display custom alerts in the status bar Activity Manager (Activity Manager) - manages the application life cycle and provides universal navigation fallback function 5. ApplicationsAndroid assembles a collection of core applications, including email clients, SMS programs, calendars, maps, browsers, and contacts and other settings. All applications are written in the Java programming language. Richer applications are waiting for us to develop! From the above we know that Android's architecture is layered, very clear, and the division of labor is clear. Android itself is a software stack (Software Stack), or "software stack architecture". The stack is mainly divided into three layers: operating system, middleware, and applications. From the above, we have also seen the power of open source. Every familiar open source software has contributed its own strength here.