Get Image Bitmap From Url
import java.io.BufferedInputStream; import java.io.InputStream; import java.net.HttpURLConnection; import java.net.URL; import java.util.Random; import android.graphics.Bitmap; import android.graphics.BitmapFactory; import android.graphics.Matrix; class Utils { public static Bitmap getImageBitmapFromUrl(URL url) { Bitmap bm = null; try { HttpURLConnection conn = (HttpURLConnection)url.openConnection(); if(conn.getResponseCode() != 200) { return bm; } conn.connect(); InputStream is = conn.getInputStream(); BufferedInputStream bis = new BufferedInputStream(is); try { bm = BitmapFactory.decodeStream(bis); } catch(OutOfMemoryError ex) { bm = null; } bis.close(); is.close(); } catch (Exception e) {} return bm; } }