分类: 嵌入式
2010-01-23 20:46:07
首先看系统架构框架图如下:
android的系统架构和其操作系统一样,采用了分层的架构。
Applications
Application Framework
Libraries
Android Runtime
Linux Kernel
Android本身是一套软件堆叠(Software Stack),主要分为三层:操作系统、中间件、应用程序。
Android的中间件可以再细分出两层,底层是函数库(
以下分别介绍每一层的作用
应用程序层(Applications)
Android会同一系列核心应用程序包一起发布,
应用程序框架层(Application Framework)
开发人员也可以完全访问核心应用程序所使用的API框架。
隐藏在每个应用后面的是一系列的服务和系统, 其中包括;
Views System:丰富而又可扩展的视图(Views),
Content Providers(内容提供器):
Resource Manager(资源管理器):提供非代码资源的访问,
Notification Manager(通知管理器):
Activity Manager(Activity管理):
函数库层(Libraries)
Android 包含一些C/C++库,
System C library – 一个从 BSD 继承来的标准 C 系统函数库( libc ), 它是专门为基于 embedded linux 的设备定制的。
Media Libraries – 基于 PacketVideo OpenCORE;该库支持多种常用的音频、
Surface Manager [...]
Android的特色
Application framework: 提供可重用可替换的组件
Dalvik virtual machine: 为移动设备优化过的Java虚拟机
Integrated browser: 基于WebKit引擎的开放源码的浏览器
Optimized graphics: 优化过的图形函数库,
SQLite: 内置SQLite数据库
Media support: 支持通用的音频,视频,和图形格式 (MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, GIF)
GSM通话(由设备硬件决定支持与否)
Bluetooth, EDGE, 3G, and WiFi (由设备硬件决定支持与否)
摄像头, GPS, 电子罗盘, 加速度感应器(由设备硬件决定支持与否)
Rich development environment: 包含了设备模拟器, 除错工具,内存和性能分析工具(我们没有用过哦), 使Eclipse支持Android开发的插件(ADT)
Like other desktop VMs, when the Dalvik VM receives a SIGQUIT (Ctrl-\ or kill -3
), it dumps stack traces for all threads. By default this goes to the Android log, but it can also be written to a file.
The dalvik.vm.stack-trace-file
-Xstacktracefile
argument.
For example:
adb shell setprop dalvik.vm.stack-trace-file /tmp/stack-traces.txt
If the property is not defined, the VM will write the stack traces to the Android log when the signal arrives.
The Dalvik Libraries, also known as the Android core libraries, implement general purpose APIs used by code written in the Java programming language. While the libraries themselves don't depend on Android, they do form the foundation of the Android framework. Android applications use the Dalvik libraries both directly and indirectly for data structures, networking, concurrency, I/O, and more.
The Dalvik libraries break down into two categories:
The Dalvik virtual machine was designed specifically for the Android mobile platform. The target systems have little RAM, store data on slow internal flash memory, and generally have the performance characteristics of decade-old desktop systems. They also run Linux, which provides virtual memory, processes and threads, and UID-based security mechanisms.
The features and limitations caused us to focus on certain goals:
It's extremely useful to be able to monitor the live state of the VM. For Android, we need to monitor multiple VMs running on a device connected through USB or a wireless network connection. This document describes a debug monitor server that interacts with multiple VMs, and an API that VMs and applications can use to provide information to the monitor.
Some things we can monitor with the Dalvik Debug Monitor ("DDM"):
Being optimized for low memory requirements, Dalvik has some specific characteristics that differentiate it from other standard VMs:
Moreover, Dalvik has been designed so that a device can run multiple instances of the VM efficiently.