App Widgets are miniature application views that can be embedded in other applications (such as the Home screen) and receive periodic updates.
Through it, you will receive broadcasts when the App Widget is updated, enabled, disabled and deleted.
that 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 set up each of these components.
First, declare the defines the essential qualities of an App Widget, such as its minimum layout dimensions, its initial layout resource, how often to update the App Widget, and (optionally) a configuration Activity to launch at create-time.
Define the App Widget Provider Info object in an XML resource using a single directory.
You can design your App Widget using the View objects listed below, but before you begin designing your App Widget, please read and understand the App Widget Design Guidelines.
Creating the App Widget layout is simple if you're familiar with Layouts.
However, you must be aware that App Widget layouts are based on , which is an invisible, zero-sized View you can use to lazily inflate layout resources at runtime.
Widgets should not generally extend to screen edges and should not visually be flush with other widgets, so you should add margins on all sides around your widget frame.
As of Android 4.0, app widgets are automatically given padding between the widget frame and the app widget's bounding box to provide better alignment with other widgets and icons on the user's home screen.
To take advantage of this strongly recommended behavior, set your application's target Sdk Version to 14 or greater.