Hackathon: Creating the simplest Muzei Wallpaper plugin for Android

Hossain Khan
2 min readMay 24, 2020
A snapshot of the ā€˜H.K. Visionā€™ Muzei Plugin on Android Device ā€” Available as BETA release on Google Play

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

  1. Download a list of image URLs+metadata and convert them into Artwork object.
  2. 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

Source code available at the GitHub repository

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:

--

--

Hossain Khan

Passionate Android developer and curious tinkerer!šŸ¤– Knowledge is poweršŸ¦ø! Share freely!šŸ“š https://hossainkhan.com/