Change wallpaper programmatically
I do not want to execute a background task just for changing wallpapers. So I write this small tool, which does the job and quit. I.e. It can change a background image by certain intent.
I am using this with https://play.google.com/store/apps/details?id=org.gemini.init, and changing wallpaper when screen is off. Ex.
https://github.com/Hzj-jie/android-init/blob/master/sample/screen-off.sh
https://github.com/Hzj-jie/android-init/blob/master/sample/change-wallpaper.sh
This application accepts three kinds of intents,
1. change wallpaper
Uri: wallpaper-changer://org.gemini.wallpaper-changer.change/?folder={folder}&file={file}
Activity: org.gemini.wallpaper_changer/.WallpaperChangerActivity
Both folder and file are optional, and you can provide several folders and files. Application will parse all parameters, list all files, and randomly select one from them.
2. set offsets
Uri: wallpaper-changer://org.gemini.wallpaper-changer.offsets/?x={x}&y={y}
Activity: org.gemini.wallpaper_changer/.WallpaperOffsetsActivity
Changes offset of wallpaper.
3. clear wallpaper
Uri: wallpaper-changer://org.gemini.wallpaper-changer.clear/?folder={folder}&file={file}
Activity: org.gemini.wallpaper_changer/.ClearWallpaperActivity