Retrieving bitmap geving unknown host exception?
<p>I am using this code to get a bitmap from the web</p>

<pre><code>  try {
        Bitmap bitmap=null;
        URL imageUrl = new URL(url);
        HttpURLConnection conn = (HttpURLConnection)imageUrl.openConnection();
        conn.setConnectTimeout(30000);
        conn.setReadTimeout(30000);
        InputStream is=conn.getInputStream(); ///Error is pointing me here
        OutputStream os = new FileOutputStream(f);
        Utils.CopyStream(is, os);
        os.close();
        bitmap = decodeFile(f);
        return bitmap;
    } catch (Exception ex){
       ex.printStackTrace();
       return null;
    }
</code></pre>

<p>The only problem is i keep getting this errror. Every to i try to get the bitmap.
The error is pointing me here: </p>

<pre><code> InputStream is=conn.getInputStream();


09-30 06:54:32.512: WARN/System.err(11149):     at java.net.InetAddress.lookupHostByName(InetAddress.java:497)
09-30 06:54:32.512: WARN/System.err(11149):     at java.net.InetAddress.getAllByNameImpl(InetAddress.java:294)
09-30 06:54:32.512: WARN/System.err(11149):     at java.net.InetAddress.getAllByName(InetAddress.java:256)
09-30 06:54:32.512: WARN/System.err(11149):     at org.apache.harmony.luni.internal.net.www.protocol.http.HttpConnection.&lt;init&gt;(HttpConnection.java:69)
09-30 06:54:32.512: WARN/System.err(11149):     at org.apache.harmony.luni.internal.net.www.protocol.http.HttpConnection.&lt;init&gt;(HttpConnection.java:48)
09-30 06:54:32.512: WARN/System.err(11149):     at org.apache.harmony.luni.internal.net.www.protocol.http.HttpConnection$Address.connect(HttpConnection.java:322)
09-30 06:54:32.512: WARN/System.err(11149):     at org.apache.harmony.luni.internal.net.www.protocol.http.HttpConnectionPool.get(HttpConnectionPool.java:89)
09-30 06:54:32.512: WARN/System.err(11149):     at org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnectionImpl.getHttpConnection(HttpURLConnectionImpl.java:285)
09-30 06:54:32.512: WARN/System.err(11149):     at org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnectionImpl.makeConnection(HttpURLConnectionImpl.java:267)
09-30 06:54:32.512: WARN/System.err(11149):     at org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnectionImpl.retrieveResponse(HttpURLConnectionImpl.java:1018)
09-30 06:54:32.512: WARN/System.err(11149):     at org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnectionImpl.getInputStream(HttpURLConnectionImpl.java:512)
</code></pre>
