How to search and connect to a specific wifi network in Android programmatically

后端 未结 2 1414
误落风尘
误落风尘 2020-12-29 00:52

If this is the layout of the app, and when the wifi is turned on, I want the list of networks available and then to connect to it by selecting any of them

2条回答
  •  无人及你
    2020-12-29 00:53

    From the first page get only third example for scanning available wifi it worked for me and I modify it to choose specific BSSID by using:

    [bssid = wifiScanList.get(i).BSSID;
        if (desiredMacAddress.equals(bssid)){ APPEND TO SHOWING LIST...}
    ]
    

    it tests it and it worked without problems+ gave what i wanted. from the second page get how to join desired access point it try it then it work with out any problems but I can't sure it gives me this functionality

    Get WiFi's SSID without connecting to it?

    one final thing if you tested second on a real device it will change its setting which will lead to problems

提交回复
热议问题