Implementing the Live Wallpaper Service

To implement a live wallpaper, we’ll use an Android service, which is a special type of application component that can be used to provide features to the rest of the system. Android provides the base live wallpaper implementation with WallpaperService, and to create a live wallpaper, all we need to do is extend this base class with our own custom implementation.[69]

Extending WallpaperService

Let’s start off by creating a new package called com.particles.android.wallpaper. In that new package, let’s create a new class called GLWallpaperService as follows:

LiveWallpaper/src/com/particles/android/wallpaper/GLWallpaperService.java
 
public​ ​class​ GLWallpaperService ​extends​ WallpaperService {
 
@Override ...

Get OpenGL ES 2 for Android now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.