In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
This article mainly introduces the Android architecture example analysis, has a certain reference value, interested friends can refer to, I hope you can learn a lot after reading this article, the following let the editor take you to understand it.
1 the architecture diagram is intuitive
The following figure shows the main components of the Android system:
It is obvious that the Android system architecture consists of five parts: Linux Kernel, Android Runtime, Libraries, Application Framework and Applications. The second part will introduce these five parts in detail.
2. Detailed explanation of the architecture
Now let's pick up the scalpel and analyze the various parts. In fact, this part of the SDK document has helped us do a good job, what we need to do is borrowlism, and then add our own understanding. Below, analyze each layer from the bottom up.
2.1 、 Linux Kerne
Android provides core system services based on Linux 2.6, such as security, memory management, process management, network stack, driver model. Linux Kernel also acts as an abstraction layer between hardware and software, hiding specific hardware details and providing unified services for the upper layer.
If you have studied the computer network to know OSI/RM, you will know that the advantage of layering is to use the services provided by the lower layer to provide a unified service for the upper layer, shielding the differences between this layer and the lower layer, when the changes in this layer and the lower layer will not affect the upper layer. In other words, each layer does its own job, 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 just do application development, you don't need to know much about the Linux Kernel layer.
2.2 、 Android Runtime
Android contains a collection of core libraries that provide most of the functionality available in the core class libraries of the Java programming language. Each Android application is an instance in the Dalvik virtual machine, running in their own process. The Dalvik virtual machine is designed to run multiple virtual machines efficiently on one device. The Dalvik virtual machine executable file format is .dex, and the dex format is a compressed format designed for Dalvik, which is suitable for systems with limited memory and processor speed.
Most virtual machines, including JVM, are stack-based, while Dalvik virtual machines are register-based. The two architectures have their own advantages and disadvantages. Generally speaking, stack-based machines need 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 more than one .class. Because dex must be * sometimes, the file size will be increased by 1-4 times, ending with ODEX.
The Dalvik virtual machine relies on the Linux kernel to provide basic functions such as threading and underlying memory management.
2.3 、 Libraries
Android contains a collection of Candlestick + libraries for use by various components of the Android system. These features are exposed to developers through Android's Application Framework (application framework). Some core libraries are listed below:
System C Library-BSD derivation of Standard C system Library (libc), adjusted to be based on embedded Linux 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-manages the 2D and 3D graphics layers that access the display subsystem and seamlessly combine multiple applications
LibWebCore-- 's new Web browser engine that drives Android browsers and embedded web views
SGL-- 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
2.4 、 Application Framework
By providing an open development platform, Android enables developers to write extremely rich and novel applications. Developers are free to take advantage of device hardware, access location information, run background services, set alarm clocks, add notifications to the status bar, and so on.
Developers can fully use the framework APIs used by core applications. The architecture of the application is designed to simplify the reuse of components so that any application can publish its functions and any other application can use them (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 browsers
Content provider (Content Providers)-enables applications to access data from other applications, such as address books, or share their 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 warnings in the status bar
Activity Manager (Activity Manager)-manages the application lifecycle and provides general navigation fallback functionality
2.***pplications
Android assembles a core collection of applications, including email clients, SMS programs, calendars, maps, browsers, contacts, and other settings. All applications are written in the Java programming language. Richer applications need to be developed!
Thank you for reading this article carefully. I hope the article "sample Analysis of Android Architecture" shared by the editor will be helpful to you. At the same time, I also hope you will support us and pay attention to the industry information channel. More related knowledge is waiting for you to learn!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.