我尝试建立与不安全的接入点的连接,但它总是使用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);
答案 0 :(得分:0)
config.allowedKeyManagement.set(KeyMgmt.NONE);