Simplecommand realizes picture download (II)

Use simplecommand to download the network picture and display it on the ImageView control.

1. Import the simplecommand framework in build.gradle of APP module. See steps 1 and 2 in Section 1 for details

2 set the URL address of the network image: here, take the request for Baidu logo image as an example

3 build a progress listener for picture download

4 build the imageloader object, pass it into the progress listener, and set whether it supports caching

5 call imageloader to download the picture and set it on the ImageView control

Briefly explain:

After step 5 above is executed, a progress prompt of 0 ~ 100% of the tag tag will be printed. After the picture is downloaded successfully, it will be displayed on the ImageView control, and the picture cache data will be saved in the storage / sdcard / Android / data / packagename / cache / picass big cache folder by default

Framework GitHub address: simplecommand framework

The above is the whole content of this article. I hope it will be helpful to your study, and I hope you can support programming tips.

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>