vitas / beaconloc

Beacon Locator - android application for scan, track and management of beacons
Apache License 2.0
104 stars 43 forks source link

How to get Beacon Distance #38

Open Miteshmakwana73 opened 3 years ago

Miteshmakwana73 commented 3 years ago

what is the formula of getting distance

i found this function but i don't understand mManagedBeacon.getDistance() get distance getting value

public String getDistance() {
        return BeaconUtil.getRoundedDistanceString(mManagedBeacon.getDistance());
    }

is it work on rssi value and masurpower or other?

Please provide the formula of getting distance like this

fun Int.getDistance(txPower: Int): Double {
    return Math.pow(10.0, ((Math.abs(this) - Math.abs(txPower)) / (10 * 2)).toDouble())
}