I came across this problem and it took me quite some time to figure it out. It was really annoying.
Suddenly each time an app accessed an internet server (http or socket connection) I got an error message "Verbindungsfehler. Bitte überprüfe Deine Internetverbindung" (English: "Connection error. Please check your internet connection"). The Android log showed this: "InetAddress(192): Unknown host mydomain.com, throwing UnknownHostException" and in another app just this: "UnknownHostException". When using an IP address instead of a domain name everything worked fine. And in the Android browser even domain names worked so it was just a problem of the apps!
In the end, after some frustrating hours of research the reason (and solution) turned out to be this: I'm running Windows on my notebook and my LAN connection is set up to have a fixed IP address and fixed DNS server which I use this in the office. The DNS server is operated by the internet provider. But then I was online with another connection - wireless - and LAN was disconnected. It appears that the Android emulator was using the DNS server of the LAN connection - though not connected - and not of the wireless connection. For some reason the DNS server did answer but with no result. You can check which DNS servers the emulator is using when starting emulator with the -debug-slirp command line argument. In my case it was the LAN DNS server as well as the wireless DNS server but it seem Android didn't care about the latter ones.
The solution was to simply to deactivate the LAN connection in Windows. See also Android Dev Guide / Emulator / DNS
Sunday, March 7, 2010
Subscribe to:
Posts (Atom)