@RequiresApi(api = Build.VERSION_CODES.JELLY_BEAN_MR2)
public void helperConnect(final ScanResult scanResult) {
try {
Log.v("rht", "Item clicked, SSID " + scanResult.SSID + " Security : " + scanResult.capabilities);
conf = new WifiConfiguration();
networkSSID = scanResult.SSID;
wifiEnterpriseConfig = new WifiEnterpriseConfig();
conf.SSID = "\"" + networkSSID + "\""; // Please note the quotes. String should contain ssid in quotes
conf.status = WifiConfiguration.Status.ENABLED;
conf.priority = 40;
if (scanResult.capabilities.toUpperCase().contains("EAP")) {
Log.v("EAP", "Configurando EAP");
conf.allowedKeyManagement.set(WifiConfiguration.KeyMgmt.WPA_EAP);
conf.allowedKeyManagement.set(WifiConfiguration.KeyMgmt.IEEE8021X);
wifiEnterpriseConfig.setIdentity(networkIdentity);
wifiEnterpriseConfig.setPassword(networkPass);
wifiEnterpriseConfig.setEapMethod(WifiEnterpriseConfig.Eap.PEAP);
wifiEnterpriseConfig.setPhase2Method(WifiEnterpriseConfig.Phase2.MSCHAPV2);
conf.enterpriseConfig = wifiEnterpriseConfig;
}
int networkId = wifiManager.addNetwork(conf);
//setWifiProxySettings(); ESTA SERIA LA FUNCION DE CONFIGURACION DEL PROXY
Log.v("rht", "Add result " + networkId);
boolean isDisconnected = wifiManager.disconnect();
Log.v("rht", "isDisconnected : " + isDisconnected);
boolean isEnabled = wifiManager.enableNetwork(networkId, true);
Log.v("rht", "isEnabled : " + isEnabled);
boolean isReconnected = wifiManager.reconnect();
Log.v("rht", "isReconnected : " + isReconnected);
} catch (Exception e) {
e.printStackTrace();
}
}
Quiero saber como es que se configura el proxy para poder conectarme. Gracias