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

Samsung Galaxy S4 – I’m quite impressed Android
Exploring PHP IDEs: PhpStorm Code
Automated Screen Launch Code
Re-Bootstrap’ing JonDavis.name Code
Mounting Box.net on Mint 12 / Ubuntu 11.10 Android
Setting up Node.JS on OSX – Quick and Easy Code

Leave a Reply Cancel reply

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

Copyright © 2026 Obviate.io.

Powered by PressBook Masonry Dark