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

A Sample Widget Application

So far, we have covered the theory and approach behind widgets. Let's create the sample widget whose behavior has been used as the example to explain widget architecture. We will develop, test, and deploy this Birthday Widget.

Each Birthday Widget instance will show a name, the date of the next birthday, and how many days from today until the birthday. It will also create an onClick area where you can click to buy gifts. This click will open a browser and take you to www.google.com.

The layout of the finished widget should look like Figure 25–5.

Image

Figure 25–5 Birthday Widget look and feel

The implementation of this ...

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