Making Live Wallpaper is bit easy in libgdx. First of all you have to implement AndroidWallpaperListener interface in your main class of core project. It have 3 methods to be implemented.. They are

	public ApplicationListener createListener () {
		return new MyApplicationListener();

	public AndroidApplicationConfiguration createConfig () {
		return new AndroidApplicationConfiguration();

	public void offsetChange (ApplicationListener listener, float xOffset, float yOffset, float xOffsetStep, float yOffsetStep,
		int xPixelOffset, int yPixelOffset) {"LiveWallpaper", "offset changed: " + xOffset + ", " + yOffset);

The methods createListener() and createConfig() will be called when your livewallpaper is shown in the picker or when it is created to be displayed on the home screen.

The offsetChange() method is scaled when the user swipes through screens on the home screen and tells you by how much the screen is offset from the center screen. This method will be called on the rendering thread, so you don’t have to synchronize anything.

Apart from this you have to make an xml which would be something like this

<?xml version="1.0" encoding="UTF-8"?>

Then you need to modify your android menifest file according to this

<uses-feature android:name="" />

	<application android:icon="@drawable/icon" android:label="@string/app_name">
		<activity android:name=".LivewallpaperSettings"
				  android:label="Livewallpaper Settings"/>

		<service android:name=".LiveWallpaper"
                <action android:name="android.service.wallpaper.WallpaperService" />
            <meta-data android:name="android.service.wallpaper"
                android:resource="@xml/livewallpaper" />

As you might have noticed that there is a LivewallpaperSettings activity being declared in menifest. Its a normal activity in android project and works just like in android wallpaper`s setting activity.

Thats it .  You can now make wallpapers in libgdx as well.


Post By:- Pranav Chaudhary