I am using below code to find nearby beacons
beaconManager = new com.estimote.sdk.BeaconManager(Test.this);
beaconManager.setForegroundScanPeriod(2000,2000);
// Should be invoked in #onCreate.
beaconManager.setRangingListener(new com.estimote.sdk.BeaconManager.RangingListener() {
@Override
public void onBeaconsDiscovered(Region arg0, final List beacons) {
Log.d(“TAG”, "Ranged beacons: " + beacons);
Log.e(“TAG”, "Ranged beacons: " + beacons);
}
});
I Get perfect result. But i want the distance between beacons or from my location.
I search for the same and find below solution.
private static float calculateBeaconDistance(int rssi, int power)
{
return (float) Math.pow(10.0, (double)(power - rssi) / 20.0);
}
But this not much accurate.
Is ther any other way?? Please show the link or any code example.
Waiting for the responce.
Thanks