

We then specify the wallpaper is defined through a separate file called “mylwp_main.xml” inside the “xml” subfolder. For the wallpaper service itself, you need the permission _WALLPAPER as well as claiming this is available through wallpaper service.

In the app’s AnroidManifest.xml as in the following example, you need to enable the feature _wallpaper. : This is responsible for showing a live wallpaper, but the service object itself does not do much except for generating instances of WallpaperService.Engine as needed.You can get the current wallpaper, get the desired dimensions for the wallpaper, set the wallpaper, and more. : This provides access to the system wallpaper.The most important APIs used in live wallpapers are as follows: Figure 1 shows the result on my Android phone.įigure 1: Live Wallpapers on the Device Key API Packages and Setup for Live Wallpapers Once you click that icon, you will be presented with a list of static wallpapers, followed by live wallpapers ready for use on your device. Yours could look slightly different due to a variety of Android platforms and devices in the market. For example, we have “Wallpaper,” “Widgets,” “Settings,” and so on. On your Android device screen, you can do a long press on the empty space, and a list of icons will be displayed at the bottom. Where to Locate Live Wallpapers on Your Mobile Device As in all my previous tutorials, complete source codes are available in the References section. Because we intend to animate the device background, a simple yet innovative concept called “boids” simulating flocking creatures also will be introduced as a bonus for our live wallpaper example. We start the tutorial by briefly introducing where you can locate the live wallpapers available on your device, what the key wallpaper APIs are, what the app setup looks like, and an example code walk-through. Implemented like a typical Android service, it is responsible for showing a live background behind applications that would like to sit on top.

It is similar to other Android apps and can use most of the available functionalities. A live wallpaper is basically a service app showing the animated and interactive background for your device screen. In this tutorial, we will turn our attention to experiment a fun feature called “Live Wallpaper” on Android devices.
