Search code examples
androidibeaconaltbeaconandroid-ibeacon

AltBeacon - reliability issues: "didExitRegion" is frequently called even if a beacon is right besides the android device


Brief process of how AltBeacon works in the app:

  • Detect iBeacon of specified ids (UUID, major/minor id)
  • Run a thread when "didEnterRegion" called (and keep running until the beacon is out of range)
  • When "didExitRegion" called, wait 30 seconds before stop the thread (this is to assure that the beacon is definitely out of the range)
  • Continue to run the thread when "didEnterRegion" called again during the 30 seconds delay and stop the thread, otherwise.

And I found some reliability problems:

  • "didExitRegion" is frequently called even when a iBeacon is right besides the app.
  • Once "didExitRegion" is called, it takes several seconds, even more than a minute sometimes, to re-scan the iBeacon even with having a
    very short scanning period setting.

My objective is to run a thread until a beacon is definitely out of a range -- in other words, I would like to secure the high reliability of the app with iBeacon integration.

Any suggestions? Am I missing something?

Any insight from you will be greatly appreciated!

Regards,


Solution

  • The problems described typically happen with a beacon that is not advertising frequently enough. A standard iBeacon transmits every 100 ms (10 Hz). Many beacon manufacturers try to extend battery life by slowing down advertisements to be much less than this standard.

    The Android Beacon Library is designed to work properly with beacons advertising every 1000 ms (1 Hz). It has a scan cycle of 1.1 seconds, giving it a high probability of detecting a beacon transmitting every one second or more.

    But some manufacturers claim long battery life by reducing the transmission rate to once every 5 seconds or less. This will cause the exact symptoms described, because the library will intermittently fail to detect the beacon, causing spurious exit and enter events.

    To solve this, consult the documentation for your beacon and configure it to transmit at least once per second or faster.