Why does Wi-Fi fail to connect to certain public networks? It won't connect to certain free official public networks in shopping malls, caffees or hospitals for example where it supposed to even with signal strength bars being 3-4. That's right gentlemen, almost full signal strength and it just stalls stating it is aquiring IP address but after a few minutes disconnects. I have this network connectivity log if it can help, otherwise guide me to the right direction and I will supply you with required logs.

03-19 13:12:22.351 I/wpa_supplicant( 8091): got scan complete 
03-19 13:12:22.351 I/wpa_supplicant( 8091): wpa_supplicant_get_scan_results:return scan results2 
03-19 13:12:22.351 I/wpa_supplicant( 8091): AP:ssid[AndroidAP],rssi[-83],BSSID=b4:07:f9:4c:b8:c1 
03-19 13:12:22.351 I/wpa_supplicant( 8091): AP:ssid[bneizion],rssi[-59],BSSID=1c:af:f7:7d:f6:d9 
03-19 13:12:22.351 I/wpa_supplicant( 8091): AP:ssid[],rssi[-67],BSSID=00:15:70:d1:60:ac 
03-19 13:12:22.351 I/wpa_supplicant( 8091): AP:ssid[],rssi[-73],BSSID=00:15:70:5f:f8:b4 
03-19 13:12:22.351 I/wpa_supplicant( 8091): AP:ssid[orange-TSZQ],rssi[-86],BSSID=00:21:04:db:fe:42 
03-19 13:12:22.351 I/wpa_supplicant( 8091): AP:ssid[zerbrachot],rssi[-73],BSSID=00:16:e3:f0:9f:39 
03-19 13:12:22.351 I/wpa_supplicant( 8091): Received 1400 bytes of scan results (6 BSSes) 
03-19 13:12:22.351 I/wpa_supplicant( 8091): wpa_driver_wext_get_scan_results--- 
03-19 13:12:22.381 D/GpsLocationProvider( 1344): GetGpsInterface+ 
03-19 13:12:22.381 D/GpsLocationProvider( 1344): GetGpsInterface- 
03-19 13:12:22.381 D/lib_locapi( 1344): loc_eng_inject_location, accuracy = 209.0 
03-19 13:12:22.411 D/AutoSetting( 4710): service - mLocationListener: onLocationChanged() location = Location[mProvider=network,mTime=1332155542386,mInfo=244.94112160000003333295.25668425,mAccuracy=209.0 
03-19 13:12:22.441 D/AutoSetting( 4710): service - handleMessage() incoming message, what:1 
03-19 13:12:22.441 D/AutoSetting( 4710): service - mLocationListener: onLocationChanged() location = Location[mProvider=network,mTime=1332155542386,mInfo=244.94112160000003333295.25668425,mAccuracy=209.0 
03-19 13:12:22.441 D/AutoSetting( 4710): Util - isSetupWizardCompleted(): true 
03-19 13:12:22.441 D/AutoSetting( 4710): Util - wifi connected 
03-19 13:12:22.441 D/AutoSetting( 4710): service - processLocationBundle() distance to current is less than 1000.0m, bypass update 
03-19 13:12:22.441 D/AutoSetting( 4710): service - handleMessage() within range
If your phone is waiting for an IP address, then your WiFi is connected. And the third last row in your log seems to confirm this status:

03-19 13:12:22.441 D/AutoSetting( 4710): Util - wifi connected

If you can't get a valid IP address, then:


the network doesn't have a DHCP server
the network has been explicitly instructed not to give IP addresses to everybody (a whitelist)
your WiFi lost a DHCPOFFER packet so it's not able to go on with the negotiation


The interesting part of the third case is that it's not necessary for the signal strength of the network to be excessively low. I suspect that also the implementation of the network components has its role in such cases. For example, I recently had lots of issues setting up a temporary WPA2 network using hostap on my home computer. My Android phone simply refused to get an IP address more than half of the times. Whatching my DHCPserver logs I noticed that the negotiation procedure stopped just because my phone stopped answering packets in the middle of the negotiation for apparently no reason. Well, I didn't investigate further the problem (too much time lost with it) but now I know that there are really many things that can go wrong setting up a WPA network.