I'm using Awareness API for my project and receiving actions via BroadcastReceiver
. This is the question with my code: link. The problem is that everything works fine in all android version except in Xiaomi devices. Where BroadcastReceiver
not receiving anything after couple of hours. I have tried many solution for this (such as this and this and turning battery saving off for my app), but nothing seems to work.
And whilst doing so, the API collates data from multiple sources to ensure that the data provided is both accurate and of a high quality. It also takes into account both the power and memory consumption when accessing these signals - helping to ensure that the battery life and memory usage of our applications do not have a detrimental effect on the users device.
As this paragraph says:
It also takes into account both the power and memory consumption when accessing these signals
and you say:
The problem is that everything works fine in all android version except in Xiaomi devices. Where BroadcastReciver not receiving anything after couple of hours
after couple of hours device may going to save more energy
You are listening for "Fence API" to register for changes in the users current environment it may consumes power and thus you do not receive broadcasts you may need to change the device settings to allow using of sensors such as location GPS and other relevant sensors