文档详情

Android系统架构详解.doc

发布:2020-11-22约7.3千字共4页下载文档
文本预览下载声明
Android系统架构详解 Android系统架构由5部分组成, 分别是:Linux Kernel、Android Runtime、Libraries、Application Framework、Applications。 1、Linux Kernel Android relies on Linux version 2.6 for core system services such as security, memory management, process management, network stack, and driver model. The kernel also acts as an abstraction layer between the hardware and the rest of the software stack.   Android基于Linux 2.6提供核心系统服务,例如:安全、内存管理、进程管理、网络堆栈、驱动模型。Linux Kernel也作为硬件和软件之间的抽象层,它隐藏具体硬件细节而为上层提供统一的服务。 如果你学过计算机网络知道OSI/RM,就会知道分层的好处就是使用下层提供的服务而为上层提供统一的服务,屏蔽本层及以下层的差异,当本层及以下层发生了变化不会影响到上层。也就是说各层各尽其职,各层提供固定的SAP(Service Access Point),专业点可以说是高内聚、低耦合。 如果你只是做应用开发,就不需要深入了解Linux Kernel层。 2、Android Runtime Android includes a set of core libraries that provides most of the functionality available in the core libraries of the Java programming language.   Android包括一个核心库的集合,她们提供了Java编程语言的核心库中的绝大多数功能。   Every Android application runs in its own process, with its own instance of the Dalvik virtual machine. Dalvik has been written so that a device can run multiple VMs efficiently. The Dalvik VM executes files in the Dalvik Executable (.dex) format which is optimized for minimal memory footprint. The VM is register-based, and runs classes compiled by a Java language compiler that have been transformed into the .dex format by the included dx tool.   每一个Android应用都在她自己的进程中运行,该进程也属于某个Dalvik虚拟机的实例。Dalvik被设计成能让设备高效地运行多个虚拟机。Dalvik虚拟机执行的是.dex结尾的Dalvik可执行文件格式,该格式被优化为最小内存使用。虚拟机是基于寄存器的,并且运行那些Java编程语言所编译的类,这些类被内置的dx工具转换为.dex格式。   The Dalvik VM relies on the Linux kernel for underlying functionality such as threading and low-level memory management.   Dalvik虚拟机依赖Linux内核来提供底层的功能,比如线程和低级内存管理。   Android包含一个核心库的集合,提供大部分在Java编程语言核心类库中可用的功能。每一个Android应用程序是Dalvik虚拟机中的实例,运行在他们自己的进程中。Dalvik虚拟机设计成,在一个设备可以高效地运行多个虚拟机。Dalvik虚拟机可执行文件格式是.dex,dex格式是专为Dalvik设计的一种压缩格式,适合内存和处理器速度有限的系统。 大多数虚拟机包括JVM都是基于栈的,而Dalvik虚拟机则是基于寄存器的。两种架构各有优劣,一般而言,基于栈的机器需要更多指令,而基于寄存器的机器指令更大。dx 是一套工具,可以将 Java .class 转换成 .dex 格式。一个dex文件通常会有多个.class。由于dex有时必须进行最佳化,会使文件大小增
显示全部
相似文档