There is a clock widget in our app. The widget needs to be updated every minute to display the time right.
In Android O, it is advised to use JobScheduler for background updates. Unfortunately, there are limitations.
- The periodic updates of JobService can not be called in less than 15 minutes intervals.
- The moment JobService.onStartJob() is unpredictable. We may miss the exact moment to update the minute digit (59th second).
Prior O we used to run a background service with Handler.postDelayed() to update the time in the widget. In O the background service can be terminated by the system.
How would you recommend to implement a clock widget in Android O?
Is this even possible now?