Skip to content

Obviate.io

To anticipate and prevent

AndroiDev: UnknownHostException

Posted on 2010-04-06 By Jon No Comments on AndroiDev: UnknownHostException

Recently I was messing around on Android with the BrowserView’s and BrowserIntent’s. When trying out one of the examples, I got:

InetAddress: Unknown host www.google.com throwing UnknownHostException

Every URL I entered, it displayed a “Page cannot be found” type error. At first I thought it was the site I was trying to use, but obviously sites like Google were up. Then I thought it might be the network connection on the emulator, but I tested its browser application and it worked fine. So that left my application.

It turns out that if you don’t have permission to use the internet, and try to — even if it is to launch the browser (and not run your own), your request is denied. Fairly good idea, in the end, although the lack of error message makes it a bit difficult to track down. In the end I realized this lack of permission was the issue and added the necessary permission (below) to my AndroidManifest.xml file.

After that and a quick rebuild, the application was much happier. I was free to abuse the internet once again. (Editor’s note: Cue maniacal laughter.)

Android, Code

Post navigation

Previous Post: Crashed WonderCon 2010 this weekend
Next Post: Review: Whitepage mobile (566587) people search

Related Posts

Review: Motorola Xoom – Hardware Android
MiFi vs Device Independent 3G Android
Photoshop CC infected with a virus called “Node.exe” Code
SocketIO IRC-style Tutorial – Part 3 – The server code Cloud
AndroiDev: The project so far – Wikinews Reader Android
Well that was dumb Code

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Copyright © 2026 Obviate.io.

Powered by PressBook Masonry Dark