{@hide}

Android allows applications to publish views to be embedded in other applications. These views are called gadgets, and are published by "gadget providers." The component that can contain gadgets is called a "gadget host." See the links below for more information.

Gadget Providers

Gadget Hosts

{@more}

Gadget Providers

Any application can publish gadgets. All an application needs to do to publish a gadget is to have a {@link android.content.BroadcastReceiver} that receives the {@link android.gadget.GadgetManager#GADGET_UPDATE_ACTION GadgetManager.GADGET_UPDATE_ACTION} intent, and provide some meta-data about the gadget.

Declaring a gadget in the AndroidManifest

Adding the {@link android.gadget.GadgetInfo GadgetInfo} meta-data

Using the {@link android.gadget.GadgetProvider GadgetProvider} class

Gadget Configuration UI

Gadget Broadcast Intents

{@link GadgetProvider} is just a convenience class. If you would like to receive the gadget broadcasts directly, you can. By way of example, the implementation of {@link GadgetProvider.onReceive} is quite simple:

{@sample frameworks/base/core/java/android/gadget/GadgetProvider.java onReceive}

Gadget Hosts

Gadget hosts are the containers in which gadgets can be placed. Most of the look and feel details are left up to the gadget hosts. For example, the home screen has one way of viewing gadgets, but the lock screen could also contain gadgets, and it would have a different way of adding, removing and otherwise managing gadgets.

For more information on implementing your own gadget host, see the {@link android.gadget.GadgetHost GadgetHost} class.