WifiConfiguration config=new WifiConfiguration();
config.BSS"+r+"\"";
config.preSharedKey = "\""+1234554321+"\"";
config.hiddenSSID = false;
config.allowedAuthAlgorithms.set(WifiConfiguration.AuthAlgorithm.OPEN);
config.allowedGroupCiphers.set(WifiConfiguration.GroupCipher.TKIP);
config.allowedKeyManagement.set(WifiConfiguration.KeyMgmt.WPA_PSK);
config.allowedPairwiseCiphers.set(WifiConfiguration.PairwiseCipher.TKIP);
config.allowedProtocols.set(WifiConfiguration.Protocol.WPA);
config.status=WifiConfiguration.Status.ENABLED;
int w=mainWifi.addNetwork(config);
boolean b=mainWifi.enableNetwork(w, true);
System.out.println("是否成功"+b);
我的安全性上面是 wpa/wpa2 psk
一直都是false
那位大侠在线啊 在线等待。。。。。