Win a copy of The Business Blockchain this week in the Cloud forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Unresolved Host Exception

 
Monu Tripathi
Rancher
Posts: 1369
1
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • 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.

 
Mark L. Murphy
Author
Ranch Hand
Posts: 131
  • Mark post as helpful
  • send pies
  • 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
  • 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
  • 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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic