i am developing an android application which have module to search all nearest / detected wifi hotspot.
i can get all detail from searched wifi hotspot like, SSID, BSSID, capabilities, frequency, level and timestamp
with these information, i also need Distance of wifi ( The distance between wifi accesspoint and Mobile Device )
i am using below lines to get Distance.
double exp = (27.55 - (20 * Math.log10(freqInMHz)) + Math.abs(levelInDb)) / 20.0;
double distanceM = Math.pow(10.0, exp);
this will return distance in meter.
i got these code by reserch on google from many pages.
but i think i am going wrong, this code is returning wrong distance. i also tried a lot on google search but not getting accurate output.
Please help me. how can i get Distance between Wifi AP and Mobile device?