O'Reilly logo

Pro Android 4 by Satya Komatineni, Dave MacLean

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required