title: Android WebView or ImageView?
body: <p>I have an App that downloads and displays images from URL's. This works fine using </p>
  
  <pre><code>URLConnection conn = urls[i].openConnection();
  conn.connect();
  if(conn.getContentLength() &gt; 0)
  is = conn.getInputStream();
  bis = new BufferedInputStream(is);
  Bitmap temp = BitmapFactory.decodeStream(bis);
  </code></pre>
  
  <p>I noticed that WebView's download and display images much faster then the above code so I thought i would try.</p>
  
  <pre><code>String url = "http:\\image.jpg"
  int mWidth = getSystemService(Context.WINDOW_SERVICE).getDefaultDisplay().getWidth()
  webView.loadData("&lt;html&gt;&lt;body&gt; &lt;img src=\"" + url + "\" width=\"" + mWidth + "px\" height=\"auto\"&gt;&lt;/body&gt;&lt;/html&gt;", "text/html", null);
  </code></pre>
  
  <p>Although this gets the image much faster it does not scale the image to the size of the screen, the large images always go beyond the WebView's width and require scrolling to view properly.</p>
  
  <p>Does anyone know how i can fix the issue to display the image properly in the WebView or how to speed up the download of the image in the first place?</p>
  
  <p>I would prefer to have the download speeded up, but i am happy to use the WebView if i can scale the image correctly. </p>