0

I'm running a small App that scans for available WLAN networks via WifiManager.startScan() / WifiReceiver. As soon as a specific open network is detected I try to connect to it by calling this code:

WifiConfiguration wifiConfig = new WifiConfiguration(); 
wifiConfig.BSSID =result.BSSID; // BSSID of detected network
wifiConfig.priority = 1; 
wifiConfig.allowedKeyManagement.set(KeyMgmt.NONE); 
wifiConfig.allowedGroupCiphers.set(WifiConfiguration.GroupCipher.TKIP); 
wifiConfig.allowedAuthAlgorithms.set(WifiConfiguration.AuthAlgorithm.OPEN); 
wifiConfig.allowedKeyManagement.set(WifiConfiguration.KeyMgmt.NONE); 
wifiConfig.status=WifiConfiguration.Status.ENABLED; 

int netId = scanData.wifiManager.addNetwork(wifiConfig); 
scanData.wifiManager.enableNetwork(netId, true);

The strange thing here: on my tablet and on some other users smartphones Android crashes! To be clear: it is not my App that fails, the whole device reboots! So what could be the reason for that? Does anybody know a workaround for this problem? Or is there something wrong with my method to connect to a network?

Thanks!

Elmi

Elmi
  • 5,899
  • 15
  • 72
  • 143
  • I think you can get the answer from this thread. http://stackoverflow.com/questions/4374862/how-to-programatically-create-and-read-wep-eap-wifi-configurations-in-android – Chanaka udaya May 11 '12 at 06:43

1 Answers1

0

OK, it seems like this problem can't be solved out of an Android App itself since it is a problem of the underlying firmware. This problem appeared with one of these crappy Archos tablets (wich are trash in general). Exactly the same code now works without any problems on a Motorola Xoom 2.

Elmi
  • 5,899
  • 15
  • 72
  • 143