Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android, listing rssi values for 5 strongest wifi networks

I am trying to make a simple app that tells me the rssi values of the 5 strongest wifi networks. I don't need to connect to any of the networks, just want to know the rssi's. At the moment I'm using the following bit of code:

wifi = (WifiManager) getSystemService(Context.WIFI_SERVICE);
int info = wifi.getConnectionInfo().getRssi();
textStatus.setText("WiFi Rssi: " + info);

However, this only displays the rssi value of the network I am connected to.

Is there a way of getting this information for other networks?

like image 650
Nico Avatar asked Nov 24 '12 18:11

Nico


People also ask

What is a good RSSI for Wi-Fi?

An RSSI closer to 0 is stronger, and closer to –100 is weaker. For best performance, you want your RSSI to be as high as possible. A useful rule of thumb is that if the RSSI is less than –70 dBm, you are unlikely to have good performance over Wi-Fi for bandwidth intensive tasks.

What is RSSI Android?

To accurately determine how close users have been to each other and whether there may have been a risk of exposure, an app needs to estimate the distance between two devices, using Bluetooth Low Energy (BLE) received signal strength indicator (RSSI) measurements.

Is RSSI 70 good?

RSSI measures the strength of a radio signal. Any RSSI value lower than -80 dBm is considered poor signal strength. Based on the client implementation some clients consider -75 dBm as poor strength as well, and will start roaming to a better Access Point, so values in the range -70 to -80 dBm are client dependent.


1 Answers

I think I got it:

ScanResult result0 = wifi.getScanResults().get(0);
String ssid0 = result0.SSID;
int rssi0 = result0.level;
String rssiString0 = String.valueOf(rssi0);
textStatus.append("\n" + ssid0 + "   " + rssiString0);

then get(1), get(2) and so on for however many you like

like image 186
Nico Avatar answered Sep 27 '22 17:09

Nico