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 the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.