Testing Live Android Wallpapers, Page 2
Testing the Live Android Wallpaper
If you've done everything right, then when you press and hold on the wallpaper of your home screen (at least, in Android 4) you'll get the following dialog.
Click here for larger image
Figure 1. Android Wallpaper Dialog on Home Screen
After that, you'll get a list of all the live wallpapers available:
Click here for larger image
Figure 2. List of All Available Android Wallpapers
And then an animated preview, when you choose Stars.
Click here for larger image
Figure 3. Animated Preview of Stars Android Wallpaper
Android Interactive Wallpapers
Live wallpapers can receive touch events and react to them. In the context of using the helper classes introduced above, simply override the onCommand()
method of RenderScriptScene, look for the WallpaperManager.COMMAND_TAP, and take some action based on the position of the tap. Although this is beyond the scope of this tutorial, the code download includes a little extra for readers to enjoy.
Conclusion
You've learned how to create a simple Android live wallpaper. While doing so, you've also learned about some of the benefits of open source projects, and a fast method of creating a RenderScript-based wallpaper. Can you modify the script to make colored stars? Make the stars float towards you? Let us know what awesome live wallpapers you've created!
About the Authors
![]() |
Shane Conder and Lauren Darcey--Contributing Editors, Mobile Development--have coauthored two books on Android development: an in-depth programming book entitled Android Wireless Application Development (ISBN-13: 978-0-321-62709-4) and Sams Teach Yourself Android Application Development in 24 Hours (ISBN-13: 978-0-321-67335-0). When not writing, they spend their time developing mobile software at their company and providing consulting services. | ![]() |
Originally published on https://www.developer.com.
Page 2 of 2
This article was originally published on January 25, 2012