codein1
codein1

Reputation: 43

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)

Upvotes: 0

Views: 884

Answers (1)

Dymas
Dymas

Reputation: 122

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.

Upvotes: 1

Related Questions