Picasso library convey lots of features similar charge images from web, resizing images, cropping images, house holder as well as displaying mistake images. Picasso from Square is opened upwards origin as well as 1 of the popular& easiest libraries used to download as well as cache images from spider web inwards android. You tin forcefulness out too charge images without using whatever libraries inwards android application, banking concern jibe out my tutorial: Load Image from URL (Internet) inwards Android.
Android Example: View Images from Web using Picasso Image Loader Library
Create a novel android projection amongst the projection advert Picasso Image Loader Library. You tin forcefulness out setup Picasso icon downloader as well as caching library amongst gradle dependency or mavne. Open your app build.gradle file as well as add together compile ‘com.squareup.picasso:picasso:2.5.2’ as application dependencies which volition hold off similar below.
XML Layout File
Open XML layout file as well as add together ImageView amongst dissimilar id. Here I convey added many ImageView as well as TextView to brand hold off similar word reader app amongst inwards LinearLayout as well as ScrollView. Just re-create as well as glue next XML code inwards your layout file.
Java Activity File
In coffee file, defile variables for dissimilar ImageView, add together images URL similar strings. Link to your layout icon thought amongst findViewById as well as charge the images inwards ImageView from spider web using Picasso library similar Picasso.with(this).load(imageURL4).resize(250, 200).into(image1);. Following is the consummate code of coffee action file.
Before running your application don’t forgot to add together user permission android.permission.INTERNET in AndroidManifest.xml file. Android manifest file volition hold off similar below.
Picasso icon downloading android library offers much to a greater extent than than merely downloading image. You tin forcefulness out resize images, display mistake icon when icon is unable to download, rotate, house holder, transform earlier icon is displayed inwards ImageView.
.error(R.drawable.error_image) // optional
.placeholder(R.drawable.placeholder_image) // optional
.resize(200, 200) // optional
.rotate(60) // optional
You convey done all things. Now, run your Load Images Using Picasso Library inwards Android application, yous volition encounter images inwards ImageView which are loaded from internet. Make certain your telephone or emulator convey WiFi or mobile network turned on.