Android download and save image through Picasso

person shubham sharmafolder_openAndroid, issueslocal_offer, , access_time October 25, 2016

1. Make sure you have picasso in your gradle build file’s dependencies tag.

2. To use the Picasso for saving image file, you need to define a Target class. This method creates a target object that you can use with Picasso. Target is an interface defined in Picasso’s library. You can define this method in your Activity class or an util class.

3. Now let’s use Picasso to download the image using the Target defined above. We use imageDir as the image directory, and my_image.jpeg for the image name, the image will be saved to /data/data/com.your.app.package.path/app_imageDir/my_image.png

4. To load the image after it’s downloaded.

 

5. To delete the image from the internal storage.

 

warningComments are closed.