android学习向导(1) - Android是什么

What is Android?

Android is a software stack for mobile devices that includes an operating system, middleware and key applications. The Android SDK provides the tools and APIs necessary to begin developing applications on the Android platform using the Java programming language.

Features

  • Application framework enabling reuse and replacement of components
  • Dalvik virtual machine optimized for mobile devices
  • Integrated browser based on the open source WebKit engine
  • Optimized graphics powered by a custom 2D graphics library; 3D graphics based on the OpenGL ES 1.0 specification (hardware acceleration optional)
  • SQLite for structured data storage
  • Media support for common audio, video, and still image formats (MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, GIF)
  • GSM Telephony (hardware dependent)
  • Bluetooth, EDGE, 3G, and WiFi (hardware dependent)
  • Camera, GPS, compass, and accelerometer (hardware dependent)
  • Rich development environment including a device emulator, tools for debugging, memory and performance profiling, and a plugin for the Eclipse IDE

Android Architecture

The following diagram shows the major components of the Android operating system. Each section is described in more detail below.

Android System Architecture

Applications

Android will ship with a set of core applications including an email client, SMS program, calendar, maps, browser, contacts, and others. All applications are written using the Java programming language.

Application Framework

By providing an open development platform, Android offers developers the ability to build extremely rich and innovative applications. Developers are free to take advantage of the device hardware, access location information, run background services, set alarms, add notifications to the status bar, and much, much more.

Developers have full access to the same framework APIs used by the core applications. The application architecture is designed to simplify the reuse of components; any application can publish its capabilities and any other application may then make use of those capabilities (subject to security constraints enforced by the framework). This same mechanism allows components to be replaced by the user.

Underlying all applications is a set of services and systems, including:

  • A rich and extensible set of Views that can be used to build an application, including lists, grids, text boxes, buttons, and even an embeddable web browser
  • Content Providers that enable applications to access data from other applications (such as Contacts), or to share their own data
  • A Resource Manager, providing access to non-code resources such as localized strings, graphics, and layout files
  • A Notification Manager that enables all applications to display custom alerts in the status bar
  • An Activity Manager that manages the lifecycle of applications and provides a common navigation backstack

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

 

-------------------------------------------------------------------------------------------------------------------------------

 

什么是Android?

Android是运行在移动设备上的包含了操作系统、中间件以及核心应用的软件堆栈. Android SDK 提供了在Android平台上基于JAVA语言的工具和API以供应用程序的开发.

特征

  • 应用框架 可重用及可扩展组件
  • Dalvik 虚拟机 为移动设备作了优化
  • 集成的浏览器 基于开源引擎 WebKit
  • 优化的图形界面 由2D图形库驱动;3D基于OpenGL ES 1.0规范(硬件加速选项)
  • SQLite 支持结构化的数据存储
  • 媒体支持 支持常用的音频、视频以及图片格式(MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, GIF)
  • GSM (如果硬件支持)
  • 蓝牙, EDGE, 3G, and WiFi (如果硬件支持)
  • 拍照, GPS, 指南针, 加速计 (如果硬件支持)
  • 丰富的开发环境包括设备模拟器、调试工具、内存与性能监测以及基于Eclipse开发工具的插件

Android的架构

下图展示了Android操作系统上的主要组件. 接下来会对每个部分进行详细的说明.

Android System Architecture

Applications

Android将会搭载一套核心应用包括有邮件客户端、SMS、日历、地图、浏览器、联系人以及其他. 所有应用都是以JAVA语言编写的.

Application Framework

通过提供一个开放性的开发平台,Android为其开发者们提供了创建丰富、创新的应用的能力. 开发者可以自由地使用设备硬件、访问本地信息、运行后台服务、设置闹钟、向状态栏添加通知消息等以及更多功能.

开发者能够使用与核心应用程序所使用的相同的框架API. 应用架构被设计成易于重用; 一个应用程序发布它的功能,其他应用可以使用这个功能(受限于框架的强制安全约束). 这一同样的机制允许组件被用户所替换.

应用程序的下层是一组服务及系统程序, 包括:

  • 一组丰富且可扩展的用与生成应用程序的组件 Views, 其中包括 列表, 表格, 文本框, 按钮, 以及内嵌的Web浏览器
  • Content Providers 允许一个应用程序从另一个应用程序访问数据,或者共享他们的数据
  • Resource Manager, 提供非编码资源的访问,例如本地字符串、图形、布局配置文件
  • Notification Manager 能够让所有的应用程序在状态栏上显示其定制化的提示
  • Activity Manager 管理应用程序的生命周期以及公共的backstack导航

应用程序的更多细节与详细讲解,请看 Notepad Tutorial.

依赖库

Android 包含了一组用于系统各种组件的C/C++库. 这些功能通过 Android 应用框架暴露给开发者. 以下列举了一些核心库:

  • 系统C语言库 - 一个继承自BSD的标准C系统实现(libc),被调整成面向基于linux的嵌入式设备
  • 多媒体库 - 基于PacketVideo的OpenCORE; 该库支持包括MPEG4, H.264, MP3, AAC, AMR, JPG以及PNG格式的音频、视频和静态图片
  • 界面管理 - 管理显示子系统的入口以及各种应用的2D与3D图形层的无缝结合
  • LibWebCore - 驱动Android浏览器与一个内嵌web视图的最新的web浏览器引擎
  • SGL - 基本的2D图形引擎
  • 3D libraries - 基于 OpenGL ES 1.0的实现; 该库使用3D加速(如果硬件支持)或包含了高度优化的3D软件光栅
  • FreeType - 位图与矢量字体的渲染
  • SQLite - 所有应用程序都可用的强大的、轻量级的关系型数据库引擎

Android运行

Android 包含了一组能够供以Java语言实现功能的核心库.

每个Android应用程序在Dalvik虚拟机实例下运行在他们自己的单独进程里. 所以Dalvik使设备能高效地运行多个虚拟机. Dalvik虚拟机执行.dex格式的文件,该文件针对小内存作了优化. Dalvik虚拟机是基于注册方式的, 并且是通过dx工具将java语言的类文件转换到.dex文件中运行的

Dalvik虚拟机依赖Linux内核的基本功能,例如线程和底层的内存管理.

Linux 内核

Android依赖Linux版本2.6的核心系统服务,例如安全、内存管理、进程管理、网络堆栈、驱动模型。 该内核也充当了硬件与软件栈之间的抽象层.

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值