Search code examples
javaandroidbeaconaltbeacon

Where is the difference between startMonitoringBeaconsInRegion and startRangingBeaconsInRegion


I don't understand the difference between the 2 methods in the BeaconManager class.

https://altbeacon.github.io/android-beacon-library/javadoc/org/altbeacon/beacon/BeaconManager.html#startMonitoringBeaconsInRegion-org.altbeacon.beacon.Region

 beaconManager.startMonitoringBeaconsInRegion(region)

https://altbeacon.github.io/android-beacon-library/javadoc/org/altbeacon/beacon/BeaconManager.html#startRangingBeaconsInRegion-org.altbeacon.beacon.Region-

beaconManager.startRangingBeaconsInRegion(region)

Solution

  • Looking at the Javadocs it appears startMonitoringBeaconsInRegion simply looks for beacons that match the Region object. The startRangingBeaconsInRegion method on the other hand will look for beacons that match the Region object and will provide updates on the distance via RangeNotifier.

    startMonitoringBeaconsInRegion: Tells the BeaconService to start looking for beacons that match the passed Region object.

    startRangingBeaconsInRegion: Tells the BeaconService to start looking for beacons that match the passed Region object, and providing updates on the estimated mDistance every seconds while beacons in the Region are visible.