To date, scan the WiFi SSID, BSSID, and RSSI
The BSSID and RSSI of the same SSID were made to output to one view.
By the way, I want to express the SSID, BSSID, and RSSI that are connected to each other (by color or *mark)
I would appreciate it if you could tell me how to display the connected SSID, BSSID, and RSSI.
android wifi listview list software_development
public static String getCurrentSsid(Context context) {
String ssid = null;
ConnectivityManager cm = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);
NetworkInfo networkInfo = cm.getActiveNetworkInfo();
if (networkInfo == null) {
return null;
}
if (networkInfo.isConnected()) {
final WifiManager wifiManager = (WifiManager) context.getSystemService(Context.WIFI_SERVICE);
final WifiInfo connectionInfo = wifiManager.getConnectionInfo();
if (connectionInfo != null && !StringUtil.isBlank(connectionInfo.getSSID())) {
ssid = connectionInfo.getSSID();
}
}
return ssid;
}
© 2024 OneMinuteCode. All rights reserved.