O'Reilly logo

Android 3.0 Animations by Alex Shaw

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

Time for action—configuring a live wallpaper

A live wallpaper can be configured by using an activity that stores preferences. When the preferences are changed, the live wallpaper is updated to reflect the new preferences.

The following are preferences that we can make available to the user to change:

  • Choosing to have interactivity or not
  • The number of bubbles that are likely to appear

So let us begin.

  1. We are going to create a particular type of activity called a PreferenceActivity. To create a PreferenceActivity, we must first create an XML description of it. Create a new file in res/xml called res/xml/wallpaperpreferences.xml. In it, put the following block of code:
    <?xml version="1.0" encoding="utf-8"?> <PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android" ...

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