Wallpaper APIs
Overview
Benefits for Developers
Before
After
Before
After
Quick Implementation Guide
1
dependencies {
implementation("net.smartlauncher:wallpaper-api:0.0.5")
}2
// Both calls are usually made from a background thread, for example from a coroutine.
yourCoroutineScope.launch(Dispatchers.IO) {
WallpaperManager.getInstance(this@MainActivity).setBitmap(bitmap)
// You can already tell the user that the new wallpaper has been applied.
val result = SmartLauncherWallpaperApi.updateWallpaper(
context = this@MainActivity,
bitmap = bitmap, // also Uri is supported
which = WallpaperManager.FLAG_SYSTEM,
metadata = SmartLauncherWallpaperApi.Metadata(
author = "Jane Doe",
link = "https://example.com/wallpaper/42",
source = "Example App"
)
)
// Useful for debugging
Log.d(TAG, "SmartLauncherWallpaperAPI returned $result")
}3
Recommendations and common errors
How to test it
Library release notes
Last updated



