Hi everyone, I have been reading a lot of your post lately, they have
been very helpfull for my Job, I have an issue trying to connect to an
Access Point secured with WEP through code, I have been able to
connect using WPA, WPA2 and OPEN security but with WEP is not getting
full connection. In fact the states of the Adapter goes like this:
idle ->associating->connecting->obtaining ip address->disconected, but
works when I use the UI.

Here are the two ways I have tried.

_wifiConfig = new WifiConfiguration();
_wifiConfig.SSID =   "\"" + _ssid + "\"";
_wifiConfig.wepKeys[0] = "\"" + _pass + "\"";
_wifiConfig.allowedKeyManagement.set(WifiConfiguration.KeyMgmt.NONE);
_wifiConfig.allowedAuthAlgorithms.set(WifiConfiguration.AuthAlgorithm.OPEN);
_wifiConfig.allowedAuthAlgorithms.set(WifiConfiguration.AuthAlgorithm.SHARED);
_wifiConfig.status = WifiConfiguration.Status.ENABLED;
_wifiReference = _wifiAdapter.addNetwork(_wifiConfig);
_wifiAdapter.enableNetwork(_wifiReference,true);

here is the other

_wifiConfig = new WifiConfiguration();
_wifiConfig.SSID =   "\"" + _ssid + "\"";
_wifiConfig.wepKeys[0] = "\"" + _pass + "\"";
_wifiConfig.allowedKeyManagement.set(WifiConfiguration.KeyMgmt.NONE);
_wifiConfig.allowedGroupCiphers.set(WifiConfiguration.GroupCipher.WEP40);
_wifiConfig.allowedGroupCiphers.set(WifiConfiguration.GroupCipher.WEP104);
_wifiConfig.allowedAuthAlgorithms.set(WifiConfiguration.AuthAlgorithm.OPEN);
_wifiConfig.allowedAuthAlgorithms.set(WifiConfiguration.AuthAlgorithm.SHARED);
_wifiConfig.status = WifiConfiguration.Status.ENABLED;
_wifiReference = _wifiAdapter.addNetwork(_wifiConfig);
_wifiAdapter.enableNetwork(_wifiReference,true);

Its there any errors here or someone has an idea what could be the
problem?

Best Regards
Mike

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

To unsubscribe from this group, send email to 
android-developers+unsubscribegooglegroups.com or reply to this email with the 
words "REMOVE ME" as the subject.

Reply via email to