Hackathon: Creating the simplest Muzei Wallpaper plugin for Android
I have a hobby of taking a lot of pictures, and some of the pictures do turn out nice (at least to me š). So, Iāve also created a web portal to showcase those pictures š¼ļø.
As an Android engineer, I was aware of Muzei Live Wallpaper app created by Roman Nurik back in 2014. Recently Iāve seen some updates from Ian Lake who took over the project while ago, so I decided to make a plugin for Muzei to use my pictures as wallpaperĀ onĀ myĀ AndroidĀ phone.
ps. If you simply want to use the plugin, see README for instruction š¤
The objective of this post is to showcase how easy it was for me to work on this ā° 1-day hackathon project to create the plugin for Muzei by following guidelines and examples provided in the Muzei GitHub repository.
Essentially, I had to do 2 major tasks to create the Android plugin
- Download a list of image URLs+metadata and convert them into
Artwork
object. - Declare a content provider on
AndroidManifest.xml
to expose the images for Muzei Live Wallpaper app.
Download Image Metadata
You can use any library of your choice to do that, Iāve followed the unsplash example and used Retrofit+WorkManager to download metadata and convert the images into Artwork
objects. See source code snapshot from GitHub.
Expose Content Provider
Based on MuzeiArtProvider
documentation, I extended my HkVisionArtProvider
from it and defined following provider specification in AndroidManifest.xml
Thatās it. Once you build and install the APK, the source will show up in the Muzei Live Wallpaper app which allows you to choose a wallpaper from a list of photos that was added to Muzei artwork provider client.
I have released the plugin app on Google Play as a public release. If you are interested, then get it on Google Play. If you do like the wallpapers, feel free to drop a line here.āļø
š» Source code of the Android project is available at GitHub repo below: