开发者

Android - connecting to Wifi without security regulations (no WEP/WPA/WPA2)

I tried to establish a connection to an unsecured Access point, but it always creates a new profile with WPA2.

            ap_ssid = "\"AP_SSID\"";
            wifiManager = (WifiManager) getSystemService(Context.WIFI_SERVICE);
            if开发者_如何转开发 (!wifiManager.isWifiEnabled()) {
                wifiManager.setWifiEnabled(true);
            }

            config = new WifiConfiguration();
            config.SSID = ap_ssid;
            config.status = WifiConfiguration.Status.ENABLED;        

            int netID = wifiManager.addNetwork(config);
            wifiManager.enableNetwork(netID, true);


config.allowedKeyManagement.set(KeyMgmt.NONE);
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜