Android: UnknownHostException Android: UnknownHostException android android

Android: UnknownHostException


The INTERNET permission tag is a child of the manifest tag, not the application tag.


For others' consideration, I ran in to this problem and a Google landed me. As mentioned by anisbet, I double checked my permission tag and it was in the right spot.

I eventually fired up the android built in browser and was getting the same response from my web server as well as Google.com (while the computer itself was fine). I terminated the android emulator and restarted; worked on the first try.

After reviewing your code, it may be worth while to restart the emulator. In all fairness to the emulator, a bunch of programs crashed shortly after doing this, so perhaps something else was going on in my computer. Still, this wasted a ton of time for me so perhaps this will save someone the headache I went though.


Make sure you have an internet connection. That's what happened to me when I forgot I am testing with mobile phone with no internet connection.