13

I'm reading existing Wi Fi configuration. Code is pretty decent

    WifiManager wifiMgr = (WifiManager) getSystemService(Context.WIFI_SERVICE);
    List<WifiConfiguration> configurations= null;
    if (wifiMgr != null)
    {
        configurations = wifiMgr.getConfiguredNetworks();
    }

I have necessary permissions:

<uses-permission android:name="android.permission.ACCESS_WIFI_STATE"></uses-permission>
<uses-permission android:name="android.permission.CHANGE_WIFI_STATE"></uses-permission>

The problem is- all (at least in my case) BSSIDs in the WifiConfiguration is NULL, despite the fact that BSSID (MAC) can be seen in the Settings. What could be the problem and how to fix it?

Alternative question- where to get code for Setting's Wifi Settings (Gingerbread), as it does show BSSIDs

dmitry.tcheban
  • 191
  • 1
  • 10
  • possible duplicate of [How to get BSSID of all wifi access points?](http://stackoverflow.com/questions/12460445/how-to-get-bssid-of-all-wifi-access-points) – Dante May Code Dec 19 '12 at 16:31
  • 1
    @DanteisnotaGeek I don’t think so. The question to which you are referring has a very specific purpose and is eventually solved through a workaround, whereas this question deals with a generic issue of the BSSID not being reported. I’m having the same issue: in `wifi_supplicant.conf` some of the configured wifis have a BSSID while others do not, but `WifiManager.getConfiguredNetworks()` returns no BSSIDs at all. – user149408 Feb 16 '17 at 20:37
  • @user149408 did you figure it out? i am having the same issue. null bssids – x0a Sep 06 '17 at 23:14
  • BSSID isn't even stored in wpa_supplicant.conf ; Additionally, android connects to any wifi with the same SSID and auth settings, paying zero regard to whether you've connected to that BSSID before or not. My android connects to every wifi network named "guest" even if I've never previously added that wifi network. – x0a Sep 09 '17 at 22:23

0 Answers0