Android创建WiFi热点WPA2-PSK(不是WPA)

时间:2015-09-26 09:41:27

标签: android android-wifi wpa

我正在使用以下代码创建wifi热点,并且它正在运行。

                    WifiConfiguration netConfig = new WifiConfiguration();
                    netConfig.SSID = apDefaultSSID;
                    netConfig.allowedAuthAlgorithms.set(WifiConfiguration.AuthAlgorithm.SHARED);
                    netConfig.allowedProtocols.set(WifiConfiguration.Protocol.WPA);
                    netConfig.allowedProtocols.set(WifiConfiguration.Protocol.RSN);
                    netConfig.allowedKeyManagement.set(WifiConfiguration.KeyMgmt.WPA_PSK);
                    netConfig.allowedKeyManagement.set(WifiConfiguration.KeyMgmt.WPA_EAP);
                    netConfig.allowedPairwiseCiphers.set(WifiConfiguration.PairwiseCipher.CCMP);
                    netConfig.allowedPairwiseCiphers.set(WifiConfiguration.PairwiseCipher.TKIP);
                    netConfig.allowedGroupCiphers.set(WifiConfiguration.GroupCipher.CCMP);
                    netConfig.allowedGroupCiphers.set(WifiConfiguration.GroupCipher.TKIP);
                    netConfig.preSharedKey = apDefaultPassword;

但它正在制作WPA-PSK安全类型。如何才能创建热点WPA2-PSK?

0 个答案:

没有答案