Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I change Watch Faces programmatically

I've a free app on the Play Store: Circus Watch Faces and I'm trying to add a watch faces chooser in the configuration activity; I followed the Android Dev Docs about it and no problems, BUT how I can switch from one watch face to another?

I'm completely new to android development so I'm trying to understad from samples and building something new. Currently I've a configuration activity with just a button and when I click on it, I'd like to change the current watch face!

My code is on GitHub (not updated with the config activity yet) if maybe can help a bit.

like image 444
Leonardo Gandini Avatar asked Sep 12 '25 20:09

Leonardo Gandini


1 Answers

There is no way to change watch face programatically. The best you can do is send a broadcast WallpaperManager.ACTION_LIVE_WALLPAPER_CHOOSER or (in the new release of Android Wear) WallpaperManager. ACTION_CHANGE_LIVE_WALLPAPER. They will invoke a watch face picker (watch faces are specialized wallpapers). The latter intent also allows you to set your watch face as a proposal for selection in the picker.

The reason for non existence of a way for setting a watch face is that it could be easily abused by apps against user's wishes.

However, since you are trying to do something from your configuration activity, maybe you want to achieve something completely different. Maybe you want to just have one WatchFaceService and then change it (draw it differently) according to some internal settings. This way if the users wants to change the appearance (even to a point where the watch face looks completely different, feels like a new watch face) you just change the underlying data and let the watch face redraw itself.

like image 88
gruszczy Avatar answered Sep 14 '25 12:09

gruszczy