public abstract class

WallpaperService

extends Service
java.lang.Object
   ↳ android.content.Context
     ↳ android.content.ContextWrapper
       ↳ android.app.Service
         ↳ android.service.wallpaper.WallpaperService

Class Overview

A wallpaper service is responsible for showing a live wallpaper behind applications that would like to sit on top of it. This service object itself does very little -- its only purpose is to generate instances of WallpaperService.Engine as needed. Implementing a wallpaper thus involves subclassing from this, subclassing an Engine implementation, and implementing onCreateEngine() to return a new instance of your engine.

Summary

Nested Classes
class WallpaperService.Engine The actual implementation of a wallpaper. 
Constants
String SERVICE_INTERFACE The Intent that must be declared as handled by the service.
String SERVICE_META_DATA Name under which a WallpaperService component publishes information about itself.
[Expand]
Inherited Constants
From class android.app.Service
From class android.content.Context
Public Constructors
WallpaperService()
Public Methods
final IBinder onBind(Intent intent)
Implement to return the implementation of the internal accessibility service interface.
void onCreate()
Called by the system when the service is first created.
abstract WallpaperService.Engine onCreateEngine()
Must be implemented to return a new instance of the wallpaper's engine.
void onDestroy()
Called by the system to notify a Service that it is no longer used and is being removed.
[Expand]
Inherited Methods
From class android.app.Service
From class android.content.ContextWrapper
From class android.content.Context
From class java.lang.Object
From interface android.content.ComponentCallbacks

Constants

public static final String SERVICE_INTERFACE

Since: API Level 7

The Intent that must be declared as handled by the service. To be supported, the service must also require the BIND_WALLPAPER permission so that other applications can not abuse it.

Constant Value: "android.service.wallpaper.WallpaperService"

public static final String SERVICE_META_DATA

Since: API Level 7

Name under which a WallpaperService component publishes information about itself. This meta-data must reference an XML resource containing a <wallpaper> tag.

Constant Value: "android.service.wallpaper"

Public Constructors

public WallpaperService ()

Since: API Level 7

Public Methods

public final IBinder onBind (Intent intent)

Since: API Level 7

Implement to return the implementation of the internal accessibility service interface. Subclasses should not override.

Parameters
intent The Intent that was used to bind to this service, as given to Context.bindService. Note that any extras that were included with the Intent at that point will not be seen here.
Returns
  • Return an IBinder through which clients can call on to the service.

public void onCreate ()

Since: API Level 7

Called by the system when the service is first created. Do not call this method directly.

public abstract WallpaperService.Engine onCreateEngine ()

Since: API Level 7

Must be implemented to return a new instance of the wallpaper's engine. Note that multiple instances may be active at the same time, such as when the wallpaper is currently set as the active wallpaper and the user is in the wallpaper picker viewing a preview of it as well.

public void onDestroy ()

Since: API Level 7

Called by the system to notify a Service that it is no longer used and is being removed. The service should clean up an resources it holds (threads, registered receivers, etc) at this point. Upon return, there will be no more calls in to this Service object and it is effectively dead. Do not call this method directly.