Q:

How to display image from URL in Android

I use this code to display image from url it work but the image is stored in device this is the problem because I want to display this image only if the user is connected to internet
ImageView imageView=(ImageView) findViewById(R.id.imageView3);
image = BitmapFactory.decodeStream(url.openConnection().getInputStream());
imageView.setImageBitmap(bitmap);

How do I display image from URL in Android? 

A:

compile "com.squareup.picasso:picasso:2.4.0"

Use this library to load images. 
Picasso.with(context)
       .load(url)
       .placeholder(R.drawable.placeholder) //optional
       .resize(imgWidth, imgHeight)         //optional  
       .centerCrop()                        //optional   
       .into(image);                        //Your image view object. 

A:

Try this solution..
image = BitmapFactory.decodeStream(url.openConnection().getInputStream());
imageView.setImageBitmap(image);

it will help you.