Please tell me how to find the distance buy the received rssi of a respective beacon

# How to find beacon distance by the received RSSI? in Android

**hell**#2

```
public double getDistance(int measuredPower, double rssi) {
if (rssi >= 0) {
return -1.0;
}
if (measuredPower == 0) {
return -1.0;
}
double ratio = rssi * 1.0 / measuredPower;
if (ratio < 1.0) {
return Math.pow(ratio, 10);
} else {
double distance= (0.42093) * Math.pow(ratio, 6.9476) + 0.54992;
return distance;
}
}
```

**sanjeev521**#3

hi hell

I am calling getdistance method in monitoring and ranging also.but why it is not calling everytime.please reply me as fast as possible…

Thanking you…

**sanjeev521**#4

the above distance formula returns in distance in what parameters like centimeters or meters etc…