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

**URL:** <https://bbs.aprbrother.com/t/how-to-find-beacon-distance-by-the-received-rssi-in-android/425>\
**Category:** AprilBeacon\
**Created:** [December 22, 2015, 11:42am UTC](https://bbs.aprbrother.com/t/how-to-find-beacon-distance-by-the-received-rssi-in-android/425 "2015-12-22T11:42:35Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![sanjeev521](https://bbs.aprbrother.com/letter_avatar_proxy/v4/letter/s/dfb087/32.png) [@sanjeev521](https://bbs.aprbrother.com/u/sanjeev521)\
**Post date:** [December 22, 2015, 11:42am UTC](https://bbs.aprbrother.com/t/how-to-find-beacon-distance-by-the-received-rssi-in-android/425/1 "2015-12-22T11:42:35Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![hell](https://bbs.aprbrother.com/letter_avatar_proxy/v4/letter/h/278dde/32.png) [@hell](https://bbs.aprbrother.com/u/hell)\
**Post date:** [December 23, 2015, 1:58am UTC](https://bbs.aprbrother.com/t/how-to-find-beacon-distance-by-the-received-rssi-in-android/425/2 "2015-12-23T01:58:34Z")

</div>

```
  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;
    		}
       }
```

---

<div class="post-metadata">

**Author:** ![sanjeev521](https://bbs.aprbrother.com/letter_avatar_proxy/v4/letter/s/dfb087/32.png) [@sanjeev521](https://bbs.aprbrother.com/u/sanjeev521)\
**Post date:** [January 29, 2016, 10:40am UTC](https://bbs.aprbrother.com/t/how-to-find-beacon-distance-by-the-received-rssi-in-android/425/3 "2016-01-29T10:40:59Z")

</div>

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…

---

<div class="post-metadata">

**Author:** ![sanjeev521](https://bbs.aprbrother.com/letter_avatar_proxy/v4/letter/s/dfb087/32.png) [@sanjeev521](https://bbs.aprbrother.com/u/sanjeev521)\
**Post date:** [January 29, 2016, 12:48pm UTC](https://bbs.aprbrother.com/t/how-to-find-beacon-distance-by-the-received-rssi-in-android/425/4 "2016-01-29T12:48:40Z")

</div>

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