I had a talk about Glance Widget today at droidcon...
# glance
p
I had a talk about Glance Widget today at droidcon Lisbon. Here is the demo application: https://github.com/PiotrPrus/WeatherGlanceWidget The widget present temperature and wind from choosen location, updating manually or every 15 minues using WorkManager.
👍 4
y
That's a really great example of cleanly using the widget state with work manager updating. I'm going to adopt a lot of this. Thanks for the great example.
p
Thanks for the kind words. Google didn't create any official guidelines about updating widgets yet, but for me the work manager makes the most sense.
m
(Back from my leave and catching up with messages) Great job on the widget. Indeed WM is the way to go, we are still working on a way to integrate it inside the framework. btw, State could use protobuf or kotlin serialization to map the state, that maybe would simplify your state helper class (or not, protobuf are complex xD)
p
Welcome back Marcel 🙂 . I was thinking about protobuf, but it may add some complexity. However the example with widget state using protobuf is a good idea for official examples 🙂
m
Thanks ☺️. Yes the setup is a bit complex. There is a good guide of the data store with protobuf that is applicable to glance too. We might include in the official sample. Kotlin serialization might be easier though
👍 1