Chinaunix首页 | 论坛 | 博客
  • 博客访问: 822053
  • 博文数量: 210
  • 博客积分: 10002
  • 博客等级: 上将
  • 技术积分: 1840
  • 用 户 组: 普通用户
  • 注册时间: 2008-11-18 09:56
文章分类

全部博文(210)

文章存档

2011年(1)

2010年(6)

2009年(65)

2008年(138)

我的朋友

分类: LINUX

2009-03-27 23:49:00

The Android OS architecture is fairly traditional, but the service and application framework is interesting and modular.


In the 3 part video below the Android team introduces the key concepts:

Intent
A class which encapsulates the intent of the user to go to another Activity. For example “send mail” or “call number”.
When an Intent is emitted, the system will try and find the registered Activity to handle it, and will start it on top of the Activity Stack.

Activity
A class implementing the UI screen to accomplish a task (like an applet). There are some default Activities available (map, mail, …). Custom Activities can plug in to replace the default ones, by registering themselves with the Activity Manager. One application can provide multiple Activities (mail app could provide 3 activities: list email, view single email, compose email).

Service
For listening to music you need an application to continue running in the background. Services can do that. Activities can connect back to the Service. Some Services come with the system (location manager, XMPP notifications from the server, …)


Views
Common controls that you can re-use to write your own Activity (a video control, a map control, a toast notification API, …)

Dalvik
Optimized JVM with good pre-loading, memory sharing across apps, and optimized bytecode and JIT.

Activity Stack
The OS keeps track of all the Activities currently running (and their respective processes). But it can decide to dehydrate an Activity to free-up memory. In that case, some data is serialized out of the process, stored in the Activity stack, and the process can be killed. Later on, this Activity can be recreated (new process, rehydrate saved data, …).

How about the iPhone? Is it similar?
Also, a quick pointer to Mono for Android. It's exciting to see .Net being making progress on new platforms thru Mono (it also , but the convenient tools are not free. Too bad, I would run to the Apple store).

阅读(1081) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~