Displaying Images With The Picasso Library in Android

Usage :-


Displaying images is easiest using a third party library such as Picasso from Square which will download and cache remote images and abstract the complexity behind an easy to use DSL.

Setup Picasso :-


Adding Picasso to our app/build.gradle file:

dependencies {
           complie "com.squareup.picasso:picasso:2.4.0"
}

You can also add an internet permission to access on your app in AndroidManifest file:

<uses-permission android:name="android.permission.INTERNET"/>

Loading an Image from URL ::


activity_dashboard.xml


Download the Code

DashboardActivity.java



Download the Code

Now you can run your app to press shift+F10.