I would like to display the SSID, BSSID, and RSSI that are currently connected through WiFi Scan.

Asked 1 years ago, Updated 1 years ago, 92 views

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

2022-09-22 19:48

1 Answers

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;
}


2022-09-22 19:48

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.