Here you can find the source of getBitmapFromInternet(String strName)
public static Bitmap getBitmapFromInternet(String strName)
//package com.java2s; //License from project: Open Source License import java.io.InputStream; import java.net.HttpURLConnection; import java.net.URL; import android.graphics.Bitmap; import android.graphics.BitmapFactory; public class Main { public static Bitmap getBitmapFromInternet(String strName) { try {//from w w w. j a va 2 s .co m URL url = new URL(strName); HttpURLConnection connection = (HttpURLConnection) url .openConnection(); connection.setDoInput(true); connection.connect(); InputStream input = connection.getInputStream(); Bitmap myBitmap = BitmapFactory.decodeStream(input); return myBitmap; } catch (Exception e) { e.printStackTrace(); return null; } } }