Get WiFi's SSID without connecting to it?

前端 未结 2 637
Happy的楠姐
Happy的楠姐 2021-01-16 05:29

I want to connect to a SSID wifi network in app.

Code:

WifiConfiguration conf = new WifiConfiguration();

conf.SSID = \"\\\"\" + network         


        
2条回答
  •  天涯浪人
    2021-01-16 06:16

    Use WifiManager#getScanResults(). This gets you a list of ScanResult objects each of which provides an SSID property.

提交回复
热议问题