BLE iBeacon Scanner for Android 5.0 and later (optimized for Android 7)

Standard

(Source link: https://github.com/prl85/BLEScanner/)

iBeacon Scanner for Android 5.0 and later – resolves ‘5 tries per 30 seconds’ limit by Android 7.0 (Nougat) and later
https://stackoverflow.com/questions/43114913/android-7-0-ble-scan-no-result
https://blog.classycode.com/undocumented-android-7-ble-behavior-changes-d1a9bd87d983
https://github.com/AltBeacon/android-beacon-library/issues/418

To resolve the scan block problem by Android 7.0, my library (BLEScanner) did made some trick like following;

  • Regardless of the requested period for scanning, BLEScanner performs BLE scan at least 6 seconds (30/5= 6 s)
  • BLEScanner externally returns scan result of requested period like the scanning is performed during the period, but internally it continues to scan without reporting result
  • If new scan is requested before BLE scan is terminated internally, BLEScanner returns scan results of new request period, and delays real BLE scan stop if necessary.

By separating result report period and real BLE scan stop timing, users can be perceived that the scan is performed during request period, while BLEScanner internally adjusts real BLE scan stop timing to cope with ‘5 tries per 30 seconds’ limit.

Leave a Reply

Your email address will not be published. Required fields are marked *