3

I'm creating wifi hotspot with the following code and it's working.

                    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;

But it's making a WPA-PSK security type.How can I create hotspot only WPA2-PSK?

Ahmad Behzadi
  • 1,006
  • 15
  • 30
  • had same issue , i tried so many [a github code](https://github.com/zxing/zxing/blob/master/android/src/com/google/zxing/client/android/wifi/WifiConfigManager.java) and [relavent ans on stack](http://stackoverflow.com/questions/28313440/how-to-connect-android-device-to-wpa2-psk-secured-wifi-hotspot-network-program?rq=1) but all fail – Indrajit Sinh Rayjada May 04 '16 at 11:50
  • @AVB Got any solution for this issue? – Yuvaraja May 25 '17 at 15:31
  • @indrajit-sinh-rayjada i am alos facing this issue now. Have u got any solution? – Yuvaraja May 25 '17 at 15:31
  • @Yuvaraja No, I couldn't do anything.... Just tried simple WPA! – Ahmad Behzadi May 28 '17 at 11:10

0 Answers0