尝试以编程方式从 Android 连接到我的无线网络。
安全类型是 WPA2,加密 AES。
这不能按预期工作:
private WifiConfiguration saveWepConfig(String password, String networkSSID) {
WifiConfiguration conf = new WifiConfiguration();
conf.SSID = "\"" + networkSSID + "\"";
// conf.wepKeys[0] = "\"" + password + "\"";
conf.preSharedKey = "\"" + password + "\"";
conf.wepTxKeyIndex = 0;
conf.hiddenSSID = true;
conf.allowedKeyManagement.set(WifiConfiguration.KeyMgmt.WPA_PSK);
conf.allowedGroupCiphers.set(WifiConfiguration.GroupCipher.WEP40);
return conf;
}
我必须在这里加密密码吗?它只保存连接,不连接。