I need to get BSSID(MAC) of all AP's. Please find below code block.
List<WifiConfiguration> test = wifiManager.getConfiguredNetworks();
for(int k=0;k<test.size();k++){
Log.d("acheck", "test BSSID = "+test.get(k).BSSID);
Log.d("acheck", "test BSSID = "+test.get(k).BSSID);
}
But above code block returns SSID properly but null for BSSID. I want to connect to strongest access point with user defined SSID. Is there any API method available to get best signal strength's AP with user defined SSID.(In my case there are many SSID's with single SSID with multiple AP's available.)
To get BSSID for currently connected WIFI network, use WiFiInfo class.
In configuration it just the setting part (eg. like the dialog that ask user/pass/ WPA or NULL blah blah)
To get BSSID from AP, you need to get it from ScanResult
Adapted the answer by @ToonSuperLove, mainly to avoid NPEs.