Nav links

Sunday, 6 May 2012

Fix for Obtaining IP Address Android problem

I occasionally had the Obtaining IP Address bug with my Huawei X5 (U8800), but it was rare enough that I never bothered looking for a fix. This is where your Wifi doesn't connect, and if you go into network settings you'll see a continuous loop of scanning , obtaining IP address, and disconnecting. But then my partner got a Sony Xperia Arc S which exhibited a similar problem much more often, so a cure was urgently required.

The Sony Xperia Arc S has a lot of user complaints about this issue, and a related one where the Wifi shows as having Limited Connectivity. Both of our phones have only exhibited these problems on our home network, which means that solutions involving changes to the home network are possible. In our case, a suggestion to try static IP addresses appears to solved the problem. It's not ideal, and it points to a problem with the phones or the wireless router, but if it leads to a resolution then that's good enough for me. So, how to we set up static IP?

Step 1: Tell your router to give a static IP to your phone. 

Go to your routers administration site. Then find DHCP settings. On my Belkin it's under Advanced Setup | LAN | DHCP Client Lists. Since my phone has already connected I can see it in the list under a host name of android-#####, next to which is a check box labelled Fix. Ticking that will ensure that whenever my phone connects it will be given the same IP address. If your phone has never connected then you can add a new entry based on the phone's MAC address, which you should be able to find in the phone's settings menu, under About phone | Status.

Step 2: Tell your phone to use a static IP address

If you are using Android 2.x (e.g. Gingerbread or Froyo) then setting a static IP address in the phone's network settings will apply to all connections, which means if you wander into McDonald's or your work, where dynamic IP addresses are used, then networking will not work until you turn off static IP. Luckily there are lots of apps to automate this switching. I used Wifi Static from farproc, which automatically switches between static and dynamic depending on which network you are connecting to. This worked really well, and totally solved my problem until I updated to Ice Cream Sandwich.

If you are using ICS then network settings apply to networks individually, so you can set your home network to use static IP, and all other networks to use dynamic. To get to the area to change this do a long press on the Wifi network to change, and click Modify network.You may then need to tick Show advanced options, and the rest should then be straightforward. Make sure to uninstall Wifi Static if you have it installed, as it is not needed in ICS.