Thursday, 26 July 2018

how to get BSSID of all connected network?

i have used the below code but it was working well but after some month i am getting a result as any instead of getting BSSID value. here is my code. please guide me any other alternative way.

 @SuppressLint("LongLogTag")
public void loadWifiAvailableList() {
    WifiManager wifiMan = (WifiManager) getApplicationContext().getSystemService(
            Context.WIFI_SERVICE);
    WifiInfo wifiInfo = wifiMan.getConnectionInfo();

    String macAddr = wifiInfo.getMacAddress();
    String bssid = wifiInfo.getBSSID();
   //here i am getting the proper bssid
    Log.d("bssid from get connection info",bssid);

    List<WifiConfiguration> list = wifiMan.getConfiguredNetworks();
    for( WifiConfiguration i : list ) {
        if(i.BSSID!=null)
     //here i am getting any from i.BSSID
        Log.d("bssid from get configured network",i.BSSID);

    }
}

enter image description here



from how to get BSSID of all connected network?

No comments:

Post a Comment