petermetz / cordova-plugin-ibeacon

An iBeacon plugin for Phonegap / Cordova 3.x and upwards. Supports both iOS and Android (contributions are welcome)
Apache License 2.0
729 stars 372 forks source link

Proximity differences between iOS and Android #111

Open daniellevass opened 9 years ago

daniellevass commented 9 years ago

Hi,

We're using this library on a PhoneGap app on both Android and iOS to scan the same estimote beacon. The issue I have is that the Android phone only considers me as "far" when I'm over 3 meters away, whereas the iPhone will consider me "far" at 1 meter.

I'm aware that the Android AltBeacon Library are doing some logic using the broadcasting power and RSSI to calculate the proximity http://stackoverflow.com/a/20434019/2623314 . However I wouldn't have expected such a vast difference whilst using exactly the same beacon.

I tested logging out the proximity and rssi values in Android and iOS (still using the same estimote beacon) with the following results:

iOS's Proximity: Immediate is anything larger than -65 (e.g. -63) Near is smaller than immediate and larger than -75 (e.g. -72). Far is anything smaller than -75 (e.g. -80)

Android's Proximity: Immediate is anything larger than - 70 (e.g. -69) Near is smaller than immediate and larger than -90 e.g. -89 Far is anything smaller than -90

The difference between Android's Far and iOS's Far seems to be considerable - is this a bug or am I doing something wrong :grinning:

Thank you,

Danielle

mrtree1 commented 9 years ago

I wouldn't get hung up on exact distances with beacons. They really aren't that accurate or reliable in that sense. If you try two different Android devices you would get two different signal values as well I expect. You should really just think of intermediate as very close (sub 1m), near as within a few metres and far as everything else until the signal disappears.

In general the algorithm in the Android library works ok for me, but because the hardware is different, from iOS and other android phones, you really don't get much accuracy (why Apple called it that I don't know, it's a complete misnomer for rough distance).

You really shouldn't see the proximity showing at far for 1m unless you have set the Tx value away from the default to be pretty extreme, in which case the proximity value will be even more unreliable than usual.

nericaamericaa commented 7 years ago

how do you even access the proximity property for android? I can't find it anywhere