http://www.androidbegin.com/tutorial/android-download-image-from-url/


import java.io.InputStream;
 
import android.os.AsyncTask;
import android.os.Bundle;
import android.app.Activity;
import android.app.ProgressDialog;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.ImageView;
 
public class MainActivity extends Activity {
 
	// Set your Image URL into a string
	String URL = "http://www.androidbegin.com/wp-content/uploads/2013/07/HD-Logo.gif";
	ImageView image;
	Button button;
	ProgressDialog mProgressDialog;
 
	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		// Get the layout from image.xml
		setContentView(R.layout.activity_main);
 
		// Locate the ImageView in activity_main.xml
		image = (ImageView) findViewById(R.id.image);
 
		// Locate the Button in activity_main.xml
		button = (Button) findViewById(R.id.button);
 
		// Capture button click
		button.setOnClickListener(new OnClickListener() {
			public void onClick(View arg0) {
 
				// Execute DownloadImage AsyncTask
				new DownloadImage().execute(URL);
			}
		});
	}
 
	// DownloadImage AsyncTask
	private class DownloadImage extends AsyncTask<String, Void, Bitmap> {
 
		@Override
		protected void onPreExecute() {
			super.onPreExecute();
			// Create a progressdialog
			mProgressDialog = new ProgressDialog(MainActivity.this);
			// Set progressdialog title
			mProgressDialog.setTitle("Download Image Tutorial");
			// Set progressdialog message
			mProgressDialog.setMessage("Loading...");
			mProgressDialog.setIndeterminate(false);
			// Show progressdialog
			mProgressDialog.show();
		}
 
		@Override
		protected Bitmap doInBackground(String... URL) {
 
			String imageURL = URL[0];
 
			Bitmap bitmap = null;
			try {
				// Download Image from URL
				InputStream input = new java.net.URL(imageURL).openStream();
				// Decode Bitmap
				bitmap = BitmapFactory.decodeStream(input);
			} catch (Exception e) {
				e.printStackTrace();
			}
			return bitmap;
		}
 
		@Override
		protected void onPostExecute(Bitmap result) {
			// Set the bitmap into ImageView
			image.setImageBitmap(result);
			// Close progressdialog
			mProgressDialog.dismiss();
		}
	}
}



<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent" >
 
    <ImageView
        android:id="@+id/image"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_centerHorizontal="true"
        android:layout_centerVertical="true" >
    </ImageView>
 
    <Button
        android:id="@+id/button"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:layout_below="@+id/image"
        android:layout_centerHorizontal="true"
        android:layout_centerVertical="true"
        android:text="@string/button" />
 
</RelativeLayout>


<resources>
 
    <string name="app_name">Download Image Tutorial</string>
    <string name="menu_settings">Settings</string>
    <string name="button">Download Image</string>
 
</resources>


<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.androidbegin.downloadimagetutorial"
    android:versionCode="1"
    android:versionName="1.0" >
 
    <uses-sdk
        android:minSdkVersion="8"
        android:targetSdkVersion="15" />
 
    <uses-permission android:name="android.permission.INTERNET" >
    </uses-permission>
 
    <application
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/AppTheme" >
        <activity android:name=".MainActivity" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
 
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
    </application>
 
</manifest>