How to connect to WPA_EAP WIFI on Android with 4.3 API

后端 未结 1 538
暖寄归人
暖寄归人 2021-02-05 18:20

Recently Android added the ability to connect to EAP WIFI with API 18 (JellyBean 4.3). I have looked for a number of examples, but can\'t find any examples, and I can\'t get my

1条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2021-02-05 19:07

    You need to set the key management

       WifiEnterpriseConfig enterpriseConfig = new WifiEnterpriseConfig(); 
       wifiConfig = new WifiConfiguration();
       wifiConfig.SSID = ssid; 
       wifiConfig.allowedKeyManagement.set(KeyMgmt.WPA_EAP);
       wifiConfig.allowedKeyManagement.set(KeyMgmt.IEEE8021X);
       enterpriseConfig.setIdentity(userName);
       enterpriseConfig.setPassword(passWord);
       enterpriseConfig.setEapMethod(WifiEnterpriseConfig.Eap.PEAP); 
       wifiConfig.enterpriseConfig = enterpriseConfig;
    

    0 讨论(0)
提交回复
热议问题