• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Tim Cooke
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Jeanne Boyarsky
Saloon Keepers:
  • Stephan van Hulst
  • Carey Brown
  • Tim Holloway
  • Piet Souris
Bartenders:

Unresolved Host Exception

 
Rancher
Posts: 1369
1
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am trying to connect to a URL, open a stream and read from it. I have the following statements in my code:


Also, I started my emulator with -http-proxy option since, I am sitting behind a firewall and access internet via a proxy.

I get Unresolved Host Exception here. I can browse to this URL from the broswer of my emulator but not through the code, which I somehow find strange.

 
Author
Posts: 131
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Did you add the INTERNET permission to your AndroidManifest.xml file?
 
Monu Tripathi
Rancher
Posts: 1369
1
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes: <uses-permission android:name="android.permission.INTERNET" />

I have also configured the proxy in the System table of the device(added a row in the system table)

sqlite> insert into system values(99,'http_proxy',<proxy:port>);

I restarted my emulator and now when I run the code as:



I see FileNotFoundException in Log. Not sure what I am missing here.

Thanks.
 
Monu Tripathi
Rancher
Posts: 1369
1
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I read about Local Networking Limitations of Emulator; could this be a problem even after configuring the proxy and everything?

Thanks.
 
What are you doing? You are supposed to be reading this tiny ad!
The Low Tech Laboratory Movie Kickstarter is LIVE NOW!
https://www.kickstarter.com/projects/paulwheaton/low-tech
reply
    Bookmark Topic Watch Topic
  • New Topic