Android 是一种运行在移动设备上的软件集,包括操作系统,中间件和应用程序. Android SDK 为开发运行在基于java语言的android平台上的应用程序提供API和工具。
特点
- 应用程序框架 可以重用和替换组建
- Dalvik 虚拟机 为移动设备优化
- 集成浏览器 基于开源的 WebKit 引擎
- 图形优化 第三方二维图形库; 基于OpenGL ES 1.0 的三维图形(可选的硬件加速)
- SQLite 结构化的数据存储
- 媒体支持 普通的音频 视频 和 图片格式(MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, GIF)
- GSM 技术 (依赖硬件)
- Bluetooth, EDGE, 3G, and WiFi (依赖硬件)
- Camera, GPS, compass, and accelerometer (依赖硬件)
- 丰富的开发环境 包括设备模拟,调试工具,内存和性能配置,Eclipse IDE 插件
Android 架构
下图展现了Android操作系统的主要成分。分别详细描述如下:
应用程序
Android 将发布一个内核程序集,包括邮件客户端,SMS程序,日历,地图,浏览器,联系人和其他。所有这些都是用java制作的。
应用程序框架
通过提供一个开放的开发平台,Android提供开发者去构建丰富并且创造性的应用程序的能力。开发者可以自由的使用设备硬件,存储本地信息,后台运行服务,设置报警,给状态栏增加提示 等等很多很多。
开发者有充足的权力通过内核应用程序去访问同样的框架API,应用程序的架构就是为了简化组建的重复使用,任何程序可以公布它的功能然后其他程序可以使用这些功能(在框架允许的安全限制内)。这些机制同样允许组建被用户使用。
列出所有服务和系统集合:
- 丰富的视图扩展集合,它可以让用户构建包括列表,网格,文本框,按钮,甚至潜入到浏览器里的应用程序。
- Content Providers 允许程序访问其他程序的数据(例如联系人),或者分享它自己的数据。
- A Resource Manager, 提供非代码资源,例如本地字符串,图形和分布文件
- A
Notification Manager
可以在状态栏里显示用户自定义的提示信息。 - An
Activity Manager
管理程序的生命周期并且提供通用的向导。
对于详细的
For more details and a walkthrough of an application, see the Notepad Tutorial.
Libraries
Android includes a set of C/C++ libraries used by various components of the Android system. These capabilities are exposed to developers through the Android application framework. Some of the core libraries are listed below:
- System C library - a BSD-derived implementation of the standard C system library (libc), tuned for embedded Linux-based devices
- Media Libraries - based on PacketVideo's OpenCORE; the libraries support playback and recording of many popular audio and video formats, as well as static image files, including MPEG4, H.264, MP3, AAC, AMR, JPG, and PNG
- Surface Manager - manages access to the display subsystem and seamlessly composites 2D and 3D graphic layers from multiple applications
- LibWebCore - a modern web browser engine which powers both the Android browser and an embeddable web view
- SGL - the underlying 2D graphics engine
- 3D libraries - an implementation based on OpenGL ES 1.0 APIs; the libraries use either hardware 3D acceleration (where available) or the included, highly optimized 3D software rasterizer
- FreeType - bitmap and vector font rendering
- SQLite - a powerful and lightweight relational database engine available to all applications
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.
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.
The Dalvik VM relies on the Linux kernel for underlying functionality such as threading and low-level memory management.
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.