Android窗口小部件App Widget开发权威指南

 应用程序的窗口部件Widgets是指可以嵌入到其他应用(比如桌面)中,并且能得到定时更新的一种微型可视化视图,这些视图我们就叫他窗口小部件。

你可以使用App Widget provider发布一个窗口小部件。能够容纳其他App Widgets的容器叫做App Widget host.下面的截图展示的是一个音乐应用的窗口部件。

下面的文档描述了如何用App Widget provider.发布一个App Widget。

AppWidgetProviderInfo  对象

描述App Widget的各种数据,比如App Widget的layout,数据更新频率,以及AppWidgetProvider类。这些是定义在xml文件里的。

AppWidgetProvider  class implementation

Defines the basic methods that allow you to programmatically interface with the App Widget, based on broadcast events. Through it, you will receive broadcasts when the App Widget is updated, enabled, disabled and deleted.

View layout

Defines the initial layout for the App Widget, defined in XML.

Additionally, you can implement an App Widget configuration Activity. This is an optional Activitythat launches when the user adds your App Widget and allows him or her to modify App Widget settings at create-time.

The following sections describe how to setup each of these components.

原文http://developer.android.com/guide/topics/appwidgets/index.html