Getting WiFi signal strength in Android

AnujAroshA picture AnujAroshA · Dec 18, 2012 · Viewed 72.3k times · Source

I can get WiFi signal level in dBm using following code.

for (ScanResult result : wifiScanResultList) {
    int signalLevel = result.level;
}

It gives negative value. When we see the default system WiFi setting and clicked on the connected WiFi network, it gives "Good" or "Bad" as signal strength. What is the range that we can filter those negative vales as "Good" signal strength or "Bad" signal strength?

Answer

Alan picture Alan · Aug 30, 2013

its an old post but this might help someone...

WifiManager wifiManager = (WifiManager) context.getSystemService(Context.WIFI_SERVICE);
int numberOfLevels = 5;
WifiInfo wifiInfo = wifiManager.getConnectionInfo();
int level = WifiManager.calculateSignalLevel(wifiInfo.getRssi(), numberOfLevels);

Documentation: public static int calculateSignalLevel (int rssi, int numLevels)