Need help with GLWallpaperService?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

209 Stars 113 Forks Apache License 2.0 132 Commits 4 Opened issues


Please submit issues and pull requests to the main repository

Services available


Need anything else?

Contributors list

# 239,104
108 commits
# 563,492
4 commits
# 67,216
4 commits
# 458,187
2 commits
# 667,723
1 commit
# 400,594
1 commit

GLWallpaperService - Version 0.9.2

Google Group


A library for making OpenGL Live Wallpapers for Android.

Provided as free open source software under the Apache License version 2.0. Parts of this software are derived from code provided by the Android Open Source Project.

Getting started making your wallpaper

Get the library

The easiest way to use this project is by downloading the latest Jar file

Once you have GLWallpaperService.jar, you can add it to your workspace:

  • If needed, setup the Android SDK and/or create a new Android workspace as you would normally
  • Create a new Android project using API level 7 or higher
  • You don't need an Activity in your project if you don't want one, but it can be nice to give users an icon to access your wallpaper settings

Add the library to your project

Now that you have your Android project, you will need to add GLWallpaperService.jar to your classpath. Here is one way you can do that if you are using Eclipse. These steps were tested in Eclipse Galileo.

  1. Create a new folder directly under your project folder called libs/
  2. Put GLWallpaperService.jar into the ProjectFolder/libs/ folder.
  3. If Eclipse doesn't see the jar, refresh your project.
  4. Right-click on your Android project. Choose Properties from the menu.
  5. Under "Java Build Path", choose the "Libraries" tab.
  6. Click on the "Add JARs...". Select GLWallpaperService.jar under ProjectFolder/libs/ and click ok. Click ok to get out of the Properties window.
  7. This will automatically add a line to your .classpath file that reads something like this:

Configure AndroidManifest.xml

The next step would be to tell the Android system that you are making a Live Wallpaper. Place the following code inside your AndroidManifest.xml between the


  • android:name=".MyWallpaperService"
    corresponds to the name of a class you will create later on. You can name it what you want, but be consistent.
  • android:resource="@xml/myglwallpaper"
    corresponds to an xml file that you will also create. Likewise, be consistent in your naming here too.

Also, add the following line to AndroidManifest.xml outside of the

 tag, but inside the 

Next, create a folder and call it ProjectFolder/res/xml. Create a new file in there and call it myglwallpaper.xml. Place the following content inside.

Add the following lines to res/values/strings.xml. Use whatever values you like.

Name of your Wallpaper
Description of your wallpaper

Renderer Implementation

Now it is time to make your two main classes, the Service class and the Renderer class. To create the Renderer class, create a new class that we'll call

. It implements the interface
and also has a method called
. Here is an example.

public class MyRenderer implements GLWallpaperService.Renderer { public void onDrawFrame(GL10 gl) { // Your rendering code goes here

    gl.glClearColor(0.2f, 0.4f, 0.2f, 1f);

public void onSurfaceChanged(GL10 gl, int width, int height) {

public void onSurfaceCreated(GL10 gl, EGLConfig config) {

 * Called when the engine is destroyed. Do any necessary clean up because
 * at this point your renderer instance is now done for.
public void release() {


Service Implementation

Finally, create a class that extends

. It behaves essentially the same as the Android class
. We'll call it
. Here is an example.

// Original code provided by Robert Green // public class MyWallpaperService extends GLWallpaperService { public MyWallpaperService() { super(); }

public Engine onCreateEngine() {
    MyEngine engine = new MyEngine();
    return engine;

class MyEngine extends GLEngine {
    MyRenderer renderer;
    public MyEngine() {
        // handle prefs, other initialization
        renderer = new MyRenderer();

    public void onDestroy() {
        if (renderer != null) {
        renderer = null;


Running the app

All that remains is to run the project on your phone or Emulator. In Eclipse, create a new run configuration of type "Android Application". Set the Project to the project you created, and click on the "Run" button. This will install the wallpaper on the phone or emulator.

To view the wallpaper, use the Android Live Wallpaper picker screen, and select your Wallpaper. If successful, the code above will display a green screen.

Congratulations, you're all ready to go! Now go forth and build an awesome OpenGL wallpaper.

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.