Android Glance Widget - How to update each full hour?

202 Views Asked by At

I have an Flutter app that shows data that are refreshed each hour.
Many users have requested a widget and I went on the task to fix it for Android and iOS.
My experience with Kotlin and Swift was "near zero", so a total noob. I need a more experience dev to give me a direction on how to handle Android.

Just finished up the widget in iOS and it was really neat and pretty easy to implement.
Apple had good guides and a clear how the widget data is handled and what to expect by the system regarding to background handling.

Now I am trying to create the same success on Android and I wanted to use "Glance" as this was the most modern design. Guides for implement data was OK and the state-handling was clear. But to update the widget each hour is pain:

  • Workmanager is not triggered on the hour whole hour (can be delayed for minutes)
  • Workmanager is not started when app starts (restart of phone makes your widget static, need a click to get it going again)

My resources for learning this was

Are there any "timeline" data handling in Android like iOS does? Or are all widgets based on a timer with highly restrictions, making the experience pretty lousy?

0

There are 0 best solutions below