Chapter 14

Invading the Home Screen

What's in this Chapter?

Creating home screen Widgets

Creating collection-based home screen Widgets

Using Content Providers to populate Widgets

Surfacing search results to the Quick Search Box

Creating Live Wallpaper

Widgets, Live Wallpaper, and the Quick Search Box (QSB) let you populate a piece of the user's home screen, providing either a window to your application or a stand-alone source of information directly on the home screen. They're exciting innovations for users and developers:

  • Users get instant access to interesting information without needing to open an application.
  • Developers get an entry point to their applications directly from the home screen.

A useful home screen Widget or Live Wallpaper increases user engagement, decreasing the chance that an application will be uninstalled and increasing the likelihood of its being used. With such power comes responsibility. Widgets run constantly as subprocesses of the home screen, so you need to be particularly careful when creating them to ensure they remain responsive and don't drain system resources.

This chapter demonstrates how to create and use App Widgets and Live Wallpaper, detailing what they are, how to use them, and some techniques for incorporating interactivity into these application components. The chapter also describes how to surface search results from your application through the QSB.

Introducing Home Screen Widgets

Home screen Widgets, more properly AppWidgets, are visual ...

Get Professional Android 4 Application Development, 3rd Edition now with the O’Reilly learning platform.

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