Load Remote Image from the Web

2 votes · 1 comment

Load a remote image from the web and return it as Bitmap. Found on anddev

raw ·
copy
· download
public Bitmap getRemoteImage(final URL aURL) { try { final URLConnection conn = aURL.openConnection(); conn.connect(); final BufferedInputStream bis = new BufferedInputStream(conn.getInputStream()); final Bitmap bm = BitmapFactory.decodeStream(bis); bis.close(); return bm; } catch (IOException e) { Log.d("DEBUGTAG", "Oh noooz an error..."); } return null; }
Add a comment

1 Comment

You can also find here - http://android-apps-blog.blogspot.com/2011/04/how-to-load-image-from-web-on-android.html an example on how to load image from web on Android.

Reply · April 20, 2011, 4:28 p.m.