Wear OS foreground service pauses after a few minutes

I’m building a Wear OS app using Flutter (I don’t believe this is a flutter-related issue).

My app needs to read data from a BLE device every 2 seconds.
I’m trying to run the long-lasting task of reading every 2 seconds in a foreground service.

When the app is backgrounded, it pauses at a certain time.
For example, if the task runs for 10 minutes in the background (all along I can see the foreground notification) the data it collects in the local database seems to pause after a few minutes, then continue when the app comes to the foreground again.

How can I solve this issue? I want the app to run in the background until the user stops it.

Thanks!

  • Can you use GATT notifications instead?

    – 

Leave a Comment