先上图
图片来源和本文参考地址:https://developer.android.com/guide/platform/index.html
Android 5.0 起的平台架构从原来的四层变成了五层,新增了一个硬件抽象层,这五层分别是Linux 内核层、硬件抽象层、原生 C/C++ 库 和 Android运行时、Java API框架层、系统应用。
Linux 内核层
Linux内核层包括电源管理和硬件驱动,硬件驱动有音频、Binder(IPC 进程间通信)、显示、键盘、蓝牙、摄像头、共享内存、USB、WIFI。
硬件抽象层
对于新增的这层,官方给出的定义是
The hardware abstraction layer (HAL) provides standard interfaces that expose device hardware capabilities to the higher-level Java API framework. The HAL consists of multiple library modules, each of which implements an interface for a specific type of hardware component, such as the camera or bluetooth module. When a framework API makes a call to access device hardware, the Android system loads the library module for that hardware component.
翻译过来就是:
硬件抽象层 (HAL) 提供标准接口,暴露设备硬件功能给上层的 Java API 框架(也就是连接底层的内核驱动和上层的Java API框架)。HAL 包含多个库模块,其中每个模块都为特定类型的硬件组件实现一个接口,例如相机或蓝牙模块。当框架 API 要求访问设备硬件时,Android 系统将为该硬件组件加载库模块。
原生 C/C++ 库
Many core Android system components and services, such as ART and HAL, are built from native code that require native libraries written in C and C++.
原生库是用C和C++编写的,许多核心 Android 系统组件和服务都依赖于这个库
原生库包含Webkit浏览器引擎、Media Framework多媒体框架、OpenGL ES图形引擎、OpenMAX AL解码器、Libc即C语言函数库 等
Android运行时
Android5.0之前的Android运行时是Dalvik,之后是ART。
Android also includes a set of core runtime libraries that provide most of the functionality of the Java programming language, including some Java 8 language features, that the Java API framework uses.
Android 还包含一套核心运行时库,提供上层 Java API 框架使用的 Java 编程语言大部分功能,包括 Java 8 新特性。
Java API框架层
这层我就不细说了,主要包括View System、ContentProvider和各类管理器
系统应用
这层系统应用指的是Android 系统自带的应用(安装在/system/app分区),比如电话、短信、联系人、日历、浏览器、电子邮件、下载等
The system apps function both as apps for users and to provide key capabilities that developers can access from their own app. For example, if your app would like to deliver an SMS message, you don't need to build that functionality yourself—you can instead invoke whichever SMS app is already installed to deliver a message to the recipient you specify.
系统应用可用作用户的应用,以及提供开发者从自己的应用访问的功能。例如,如果您的应用要发短信,您无需自己构建该功能,可以改为调用已安装的短信应用向您指定的接收者发送消息。
网友评论