Wallpaper APIs
Overview
Benefits for Developers
Before
After


Before
After


Quick Implementation Guide
1
dependencies {
implementation("net.smartlauncher:wallpaper-api:0.0.4")
}2
if(/* do not run if you are only changing the lockscreen wallpaper */){
val result = SmartLauncherWallpaperApi.saveWallpaper(
context = context,
bitmap = wallpaperBitmap, // also Uri is supported
metadata = SmartLauncherWallpaperApi.Metadata(
author = "Jane Doe",
link = "https://example.com/wallpaper/42",
source = "Example App"
)
)
// Useful for debugging
Log.d(TAG, "SmartLauncherWallpaperAPI returned $result")
}
// IMPORTANT! Wait for SmartLauncherWallpaperApi.saveWallpaper to return,
// before setting the wallpaper.
WallpaperManager.getInstance(this).setBitmap(bitmap)3
Recommendations and common errors
How to test it
Experimental Status
Library release notes
Last updated