I have a WearableListenerService
on a phone app that receives a DataItem
from the watch (in onDataChanged
). The code is essentially the same you have on the documentation (I can put it here if useful).
When a new DataItem
is received, I show a notification to the user on the phone.
It works for Android 5, regardless if the app is running or killed. It also works on Android O API 26 if the app is running/in memory, but it doesn't if I kill the app first (by swiping): the WearableListenerService
does not run then.
I'm aware of the background execution limits on Android 8, but I don't how to deal with them in this case since it's Android that should start the service while my app is in background so that I can react to the Data Layer changes.
Is there a way to listen for Data Layer events on Android 8 while the app is in background?