0

I am using Android Beacon Library for beacon detection.

I configure the application to have a background between scan period of 22 seconds. After several hours of testing, I observed that the scan does not happen every 22 seconds. Sometimes there are upto 10 minute periods without a scan. I could see an inconsistency in bluetooth scans. What could be the reason for that?

Will turning off the optimizations (Doze mode) help? Thanks

Parth Parekh
  • 123
  • 11

1 Answers1

1

It's hard to know for sure what is causing this without seeing setup code or log results. You can read more about how Doze affects scanning in this blog post:

http://www.davidgyoungtech.com/2015/09/29/is-your-beacon-app-ready-for-android-6

Since that was written Android 7 came out, new changes were added to Doze as described here: https://developer.android.com/about/versions/nougat/android-7.0-changes.html

Those newer Android 7 changes do not affect the way the Android Beacon Library schedules regular scans, although they do affect the use of the AlarmManager to keep the app alive in the event of being killed by the OS due to low memory or some other condition. But this should generally not be triggered in Doze mode.

What is described may also be caused by a third party battery saving OS enhancement put into a custom ROM by the manufacturer.

davidgyoung
  • 63,876
  • 14
  • 121
  • 204