If you want to get the strength of some wifi , you can use wifi manager class and can get list of available wifis like this
WifiManager manager;
manager = (WifiManager) getSystemService(WIFI_SERVICE);
List<ScanResult> res = manager.getScanResults();
int level = getPowerPercentage(res.get(0).level);
Method to find wifi signal stength like this :
public int getWifiPercentage(int pow) {
int i = 0;
int MIN = -100;
if (power <= MIN) {
i = 0;
} else {
i = 100 + power;
}
return i;
}
0 Comment(s)