Added in API level 7

WallpaperService

abstract class WallpaperService : Service
kotlin.Any
   ↳ android.content.Context
   ↳ android.content.ContextWrapper
   ↳ android.app.Service
   ↳ android.service.wallpaper.WallpaperService

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 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
open

The actual implementation of a wallpaper.

Constants
static String

The Intent that must be declared as handled by the service.

static String

Name under which a WallpaperService component publishes information about itself.

Inherited constants
Public constructors

Public methods
IBinder?
onBind(intent: Intent!)

Implement to return the implementation of the internal accessibility service interface.

open Unit

abstract WallpaperService.Engine!

Must be implemented to return a new instance of the wallpaper's engine.

open Unit

Protected methods
open Unit
dump(fd: FileDescriptor!, out: PrintWriter!, args: Array<String!>!)

Inherited functions

Constants

SERVICE_INTERFACE

Added in API level 7
static val SERVICE_INTERFACE: String

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

Value: "android.service.wallpaper.WallpaperService"

SERVICE_META_DATA

Added in API level 7
static val SERVICE_META_DATA: String

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

Value: "android.service.wallpaper"

Public constructors

WallpaperService

WallpaperService()

Public methods

onBind

Added in API level 7
fun onBind(intent: Intent!): IBinder?

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

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

onCreate

Added in API level 7
open fun onCreate(): Unit

onCreateEngine

Added in API level 7
abstract fun onCreateEngine(): WallpaperService.Engine!

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.
This method must be called from the main thread of your app.

onDestroy

Added in API level 7
open fun onDestroy(): Unit

Protected methods

dump

Added in API level 7
protected open fun dump(
    fd: FileDescriptor!,
    out: PrintWriter!,
    args: Array<String!>!
): Unit
Parameters
fd FileDescriptor!: The raw file descriptor that the dump is being sent to.
writer The PrintWriter to which you should dump your state. This will be closed for you after you return.
args Array<String!>!: additional arguments to the dump request.