I have an image link from server, I want to show it in my android app, I tried this code but not worked for
imageview.setImageURI(Uri.parse("pathofimage"));
Image link is like http:/54.70.37.32/uploads/Provider_profile_pic.jpg
I have an image link from server, I want to show it in my android app, I tried this code but not worked for
imageview.setImageURI(Uri.parse("pathofimage"));
Image link is like http:/54.70.37.32/uploads/Provider_profile_pic.jpg
You can use the Picasso API which has many builtin functions for example:
Masking images
Now How to use Picasso Library for loading the ImageViews, here it is step by step.
Add Picasso API in your app.gradle file
compile 'com.squareup.picasso:picasso:2.5.2'
Now you can load image with following simple line
Picasso.with(context).load("https://i.stack.imgur.com/jEIKP.jpg").into(imageView);
for further Info go to : Picasso
Use Picasso Library like this.
Gradle dependency:
compile 'com.squareup.picasso:picasso:2.5.2'
then in your code use this to set image
Picasso.with(YOUR_ACTIVITY_INSTANCE).
load(IMAGE_URL).into(IMAGE_VIEW);
you can also use Glide.
Use Android-Universal-Image-Loader
ImageLoader imageLoader = ImageLoader.getInstance(); // Get singleton instance
// Load image, decode it to Bitmap and display Bitmap in ImageView (or any other view
// which implements ImageAware interface)
imageLoader.displayImage(imageUri, imageView);
// Load image, decode it to Bitmap and return Bitmap to callback
imageLoader.loadImage(imageUri, new SimpleImageLoadingListener() {
@Override
public void onLoadingComplete(String imageUri, View view, Bitmap loadedImage) {
// Do whatever you want with Bitmap
}
});