Skip to content

Obviate.io

To anticipate and prevent

  • Home
  • About Us
  • History
  • Privacy Policy
  • Toggle search form

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

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.

April 2010
S M T W T F S
 123
45678910
11121314151617
18192021222324
252627282930  
« Mar   May »

Copyright © 2022 Obviate.io

Powered by PressBook Premium theme