Open atotalnoob opened 4 years ago
Is this related to #198?
It's hard to say for sure why this might happen without seeing the raw timestamps of when the scans started and ended.
Two points that may affect your measurements:
The issue reported in #198 may affect this as well, but that should cause an early detection only once each time a new beacon is detected in the background after a period where no beacons are visible.
Expected behavior
didRangeBeaconsInRegion only is called after the scanning interval elapses. IE with these intervals:
didRangeBeaconsInRegion is called no more than once every
2111ms
Actual behavior
didRangeBeaconsInRegion is called more than once per scanning interval. We take one timestamp at the beginning of the callback and then utilize that timestamp for all of our beaconLogs. Once the beaconLogs have all been created, they are sent to our API.
Querying our database revealed that, the frequency being divisible by 2000 meant it was more likely to be less than the scanning interval.
We changed our interval from
2100
to2111
(prime number) and repeated the experiment.I would share the logs, but this seems to be reproducible across devices, given enough time, and is difficult to gather logs for.
Steps to reproduce this behavior
Using the sample application, set up foreground service, put beacons at various broadcasting frequencies nearby the device, (<1m) let scan for 24 hours, calculate minimum time between broadcast.
Mobile device model and OS version
Nokia 4.2 TA-1133
- Android 9Samsung T-380
- Android 9Pixel 3a
- Android 10Nexus 9
- Android 5,6,7Android Beacon Library version
implementation 'org.altbeacon:android-beacon-library:2.16.3-beta4@aar'