Is it possible to set the android wallpaper image programatically? I'd like to create a service that downloads an image from the web and updates the home screen wallpaper periodically.
Choose a background wallpaperRight-click your desktop. Select Set wallpaper & style. Select Wallpaper. Select one of the images to set as your wallpaper.
If you have image URL then use
WallpaperManager wpm = WallpaperManager.getInstance(context); InputStream ins = new URL("absolute/path/of/image").openStream(); wpm.setStream(ins);
If you have image URI then use
WallpaperManager wpm = WallpaperManager.getInstance(context); wpm.setResource(Uri.of.image);
In your manifest file:
<uses-permission android:name="android.permission.SET_WALLPAPER"></uses-permission>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With