Search code examples
androidimagewallpaper

Android - how to set the wallpaper image


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.


Solution

  • From this page on the developer site:

    public void setStream (InputStream data)
    

    Change the current system wallpaper to a specific byte stream. The give InputStream is copied into persistent storage and will now be used as the wallpaper. Currently it must be either a JPEG or PNG image.