When i try load an Image, Unknown Host Exception in Android
<p>When i try to load an image into android it gives me the following error</p>

<pre><code>06-10 11:08:50.217: WARN/System.err(868): java.net.UnknownHostException: nopsa.hiit.fi
06-10 11:08:50.217: WARN/System.err(868):     at java.net.InetAddress.lookupHostByName(InetAddress.java:497)
06-10 11:08:50.217: WARN/System.err(868):     at java.net.InetAddress.getAllByNameImpl(InetAddress.java:294)
06-10 11:08:50.217: WARN/System.err(868):     at java.net.InetAddress.getAllByName(InetAddress.java:256)
06-10 11:08:50.237: WARN/System.err(868):     at org.apache.harmony.luni.internal.net.www.protocol.http.HttpConnection.&lt;init&gt;(HttpConnection.java:69)
06-10 11:08:50.237: WARN/System.err(868):     at org.apache.harmony.luni.internal.net.www.protocol.http.HttpConnection.&lt;init&gt;(HttpConnection.java:48)
06-10 11:08:50.272: WARN/System.err(868):     at org.apache.harmony.luni.internal.net.www.protocol.http.HttpConnection$Address.connect(HttpConnection.java:322)
06-10 11:08:50.272: WARN/System.err(868):     at org.apache.harmony.luni.internal.net.www.protocol.http.HttpConnectionPool.get(HttpConnectionPool.java:89)
06-10 11:08:50.272: WARN/System.err(868):     at org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnectionImpl.getHttpConnection(HttpURLConnectionImpl.java:285)
06-10 11:08:50.277: WARN/System.err(868):     at org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnectionImpl.makeConnection(HttpURLConnectionImpl.java:267)
06-10 11:08:50.277: WARN/System.err(868):     at org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnectionImpl.retrieveResponse(HttpURLConnectionImpl.java:1018)
06-10 11:08:50.297: WARN/System.err(868):     at org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnectionImpl.getInputStream(HttpURLConnectionImpl.java:512)
</code></pre>

<p>The file i'm trying to access is
<a href="http://nopsa.hiit.fi/pmg/viewer/images/thumb_132750728_8f0342f1ac_t.jpg" rel="nofollow">http://nopsa.hiit.fi/pmg/viewer/images/thumb_132750728_8f0342f1ac_t.jpg</a></p>

<p>and the code i used inside onDraw() is following</p>

<pre><code>try {
   URL url = new URL(collectable.getIcon_url());                     
   HttpURLConnection connection  = (HttpURLConnection) url.openConnection();
   InputStream is = connection.getInputStream();
   Bitmap img = BitmapFactory.decodeStream(is);                 
   canvas.drawBitmap(img, 100, 100 , null);
} catch (Exception e) {
   Log.d(TAG, "Image Load Failed");
   e.printStackTrace();
}
</code></pre>
