How to make Android Live Wallpaper using LibGDx?

I want to make Android Live Wallpaper. I want to use LibGDx. I found this information: http://www.badlogicgames.com/wordpress/?p=2652

Sorry, ahter copy the code to my wallpaper, eclipse show error.

Does anyone know how to make wallpapers using libgdx?

Eclipse shows the following information: "MyApplicationListener cannot be resolved to type"? 3 quick fixes are available: 1. create classes MyApplicationListener 2. change to "ApplicationListener" (com.badlogic.gdx) 3. Fix project settings

After selecting 2 fix, eclipse shows another error: "Unable to create an instance of ApplicationListener of type"

I solved the problem using HaMMeReD.

My code in android project:

public class MainActivity extends AndroidLiveWallpaperService { @Override public ApplicationListener createListener(boolean isPreview) { // TODO Auto-generated method stub return new SexyWomen();// here should be wrote name of class form main LibGDx project } @Override public AndroidApplicationConfiguration createConfig() { // TODO Auto-generated method stub return new AndroidApplicationConfiguration(); } @Override public void offsetChange(ApplicationListener listener, float xOffset, float yOffset, float xOffsetStep, float yOffsetStep, int xPixelOffset, int yPixelOffset) { // TODO Auto-generated method stub Gdx.app.log("LiveWallpaper", "offset changed: " + xOffset + ", " + yOffset); } } 
+4
source share
1 answer

Put your code back as it was.

Select option 3 for quick fix.

It should include the Main Gdx project in your build path and fix this error.

Manually go to the Java-Build-Path / Projects tab and add the Gdx project.

Your base project needs access to your main gdx project to find this class.

+3
source

All Articles