0

Since it's known that scanning beacons shouldn't require an internet connection, we were expecting Android Beacon Library by AltBeacon to detect beacons the same when the device is with or without an internet connection. Unfortunately, this is not the case in Android 11.

We've recently implemented the Android Beacon Library in our app and noticed a significant latency on Android 11 when the device is not connected to the internet (tested on Xiaomi 11). In contrast, on an Android 12 device the beacon detection works fast with or without an internet connection (tested on Xiaomi 12).

The latency seems to be caused by the call of the rangingObserver declared in:

beaconManager.getRegionViewModel(region).rangedBeacons.observe(this, rangingObserver)

It might be worth mentioning that we've also noticed a similar issue in the Beacon Scanner App which also implemented with the Android Beacon Library. Again, without an internet connection, the scanner has a significant latency in rendering the scanning list on an Android 11 device.

Has anyone encountered this issue or has any idea how this can be solved?
Please advise.

See a screenshot of Beacon Scanner App with and without Internet

Replication guidelines:

  1. Use an Android 11 device.

  2. Download the Beacon Scanner App.

  3. Turn off any internet connection on your device (including Mobile Data and Wi-Fi).

  4. Put several beacons in the region.

  5. Launch the Beacon Scanner app and start scanning (important: make sure to kill the app if it was open before).

  6. You should notice that the app is scanning but presents empty results for about a minute or more.

  7. Try to launch the app with an active internet connection (via Mobile Data or Wi-Fi) and you will notice the detection happens instantly.

Gilu
  • 1
  • 1
  • How specifically are you disabling the internet connection? Does the mechanism of disabling it matter? E.g. if you leave WiFi and Mobile Data on, but do not connect to a WiFi net owl and remove the SIM card, do you a I’ll see this issue? Similarly does the same hold for other combinations of disabling internet (leaving WiFi connected but remove SIM card, etc.) – davidgyoung Jan 13 '23 at 01:26
  • @davidgyoung the mechanism of disabling the internet connection does not seem to matter. As long as you are not connected to an active internet network you should encounter this latency issue on an Android 11 device. I'd appreciate your check and advice. thanks! – Gilu Jan 17 '23 at 01:45
  • Unfortunately, the only Xiaomi phone I have cannot be upgraded to Android 11, and doesn't have this issue. Can you reproduce the issue with the reference app? https://github.com/davidgyoung/android-beacon-library-reference-kotlin – davidgyoung Jan 17 '23 at 17:43
  • @davidgyoung I will do it and will let you know shortly. Meanwhile, if by any chance you have another Android 11 phone (not especially a Xiaomi) and you can check it out that will be great. Anyway, I'll keep you posted soon. thanks. – Gilu Jan 18 '23 at 22:01

0 Answers0