Architecture of Home Screen Widgets

Let's start our discussion of home screen widgets architecture by considering what home screen widgets are in greater detail.

What Are Home Screen Widgets?

Home screen widgets are views that can be displayed on a home page and updated frequently. As a view, a widget's look and feel is defined through a layout XML file. For a widget, in addition to the layout of the view, you will need to define how much space the view of the widget will need on the home screen.

A widget definition also includes a couple of Java classes that are responsible for initializing the view and updating it frequently. These Java classes are responsible for managing the life cycle of the widget on the home screen. These classes respond ...

Get Pro Android 4 now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.