java.net.UnknownHostException

Put problem concerning Views, Layouts and other XML-Resources (like AndroidManifest) here.

java.net.UnknownHostException

Postby faisalloe » Thu Dec 03, 2009 7:51 am

Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1. public static final String readURL(String url)throws Throwable
  2.  
  3. {
  4.  
  5.                 try {
  6.  
  7.                         InputStream in = (InputStream) fetch(url);
  8.  
  9.                         byte[] bArr = readBytes(in);
  10.  
  11.                         return new String(bArr);
  12.  
  13.                 } catch (Throwable e) {
  14.  
  15.                         throw e;
  16.  
  17.                         }
  18.  
  19. }
  20.  
  21.  
  22.  
  23.  
  24.  
  25. public static final Object fetch(String address) throws MalformedURLException,IOException {
  26.  
  27.         URL url = new URL(address);
  28.  
  29.         Object content = url.getContent();
  30.  
  31.         return content;
  32.  
  33. }
Parsed in 0.031 seconds, using GeSHi 1.0.8.4




I am behind proxy and When i try

readURL("http://abc.com")

to access URL http://abc.com it throws java.net.UnknownHostException: I am having in manifest file.

any quick solution.
faisalloe
Developer
Developer
 
Posts: 29
Joined: Wed Nov 04, 2009 5:01 am

Top

Re: java.net.UnknownHostException

Postby jagtap.jj1 » Tue Dec 08, 2009 6:54 am

Your emulator is not connected to Internet through proxy, use proxy emulator options while launching emulator
http://developer.android.com/guide/deve ... html#proxy
java-android developer
User avatar
jagtap.jj1
Senior Developer
Senior Developer
 
Posts: 124
Joined: Fri Aug 22, 2008 11:52 am
Location: India(Mumbai)

Top

Return to View, Layout & Resource Problems

Who is online

Users browsing this forum: Google Feedfetcher and 4 guests