0

I am using android beacon library for beacon scan. And My android device is running Android 6 ( Samsung Galaxy S5).

In background mode, The app is not detecting beacon for 5 sec. (Not getting scan result callback). then it will work for 11 sec(every new scan cycle) and again it stops for 5 sec.

Note: For Android 8 and 9 it's working without issue.

These are the parameter I am using for the scan.

setBackgroundBetweenScanPeriod(1100l);
setBackgroundScanPeriod(11000l);

As per logs, I observe that scheduleScanCycleStop() only calling that 5-sec interval(at every second).

By modifying setBackgroundScanPeriod to 1100 then its working fine. Is it possible to achieve the same behavior with larger BackgroundScanPeriod value?

Can anyone explain where I am doing wrong?

Thanks

Logs for 30 sec

Parth
  • 1,908
  • 1
  • 19
  • 37
  • Can you please set BeaconManager.setDebug(true); then show a LogCat excerpt of about 30 seconds in the background? It would also be useful to know if you see the same results with the reference app modified for the same scan cycles. – davidgyoung Jan 04 '19 at 13:25
  • Added logs in question. – Parth Jan 04 '19 at 17:53
  • I'm afraid I don't understand the problem. The logs look normal, and I see it maintain a cycle of scanning for 11 seconds, then stopping briefly then scanning again for 11 seconds. The log shows intermittent detections, but I don't see any obvious pattern to when they occur. Why do you say it is not detecting for 5 seconds? If you are using ranging APIs with these scan intervals, you would expect a ranging callback every 11-12 seconds with a list of beacons seen in that interval. I'm not sure how you'd even know if it doesn't detect beacons for 5 seconds -- that's library internals. – davidgyoung Jan 04 '19 at 21:44

0 Answers0