Skip to content

Tutorial: Live Wallpaper in Android Studio

Tewan edited this page Jan 10, 2019 · 1 revision

For information on how to set up the wallpaper, check out another tutorial like this one. This tutorial only shows how you tell your WallpaperService class to load Processing.

// Make a new class that extends PWallpaper. 
// PWallpaper is a processing class that extends WallpaperService, 
// so you are going to be able to reference this class
// in your xml files etc.
public class Wallpaper extends PWallpaper {
    
    // Override the createSketch() function and return your sketch class.
    @Override
    public PApplet createSketch() {
        return new Sketch();
    }

}
public class Sketch extends PApplet {

    public void settings() {
        fullScreen(); // This is (kind of) important for wallpapers!
    }

    public void setup() {
        // ...
    }

    public void draw() {
        // ...
    }
}