Search code examples
altbeaconbeaconandroid-ble

android maximum regions to ranging and monitoring


I want to track all nearby beacons using global region, then i create individual region for each ranged region from the global region, is there any regions limit for android phone ? i've read that in the ios regions are limited into 20 max.

Any help would be appreciated


Solution

  • Short answer: The Android Beacon Library has no hard limit on the number of regions you can range or monitor.

    Longer answer: If you go beyond a reasonable number of monitored or ranged regions (a few dozen), you may experience some issues:

    • Elevated CPU and battery usage will be needed to process all the region matches

    • A maximum of 50 monitored regions will has their state persisted across app restarts. If you go beyond 50 monitored regions, then this persistence will no longer happen, and the app will receive duplicate region entry events for nearby beacons each time the operating system restarts the app due to memory pressure.

    As an alternative to monitoring a very large number of regions, consider using broader wildcard patterns in a smaller number of regions (basically specify fewer identifiers that must be matched) and then read the specific identifiers in ranging callbacks and custom logic based on the identifier patterns you see there.

    It is worth noting that with iOS CoreLocation, there is also no limit to the number of regions that may be ranged. The limit of 20 regions is for monitoring only, and applies to both geofence regions and beacon regions.