使用 picasso 从 url 获取图像

Sid*_*Sid 0 url android image picasso

我想从 url 加载图像并将其保存在 sd 卡中的文件中,然后从文件加载并显示在图像视图中。

所以我正在尝试使用毕加索加载图像。但它没有显示在图像视图上。

这是网址:

http://xesoftwares.co.in/contactsapi/profile_images/d34b638b93773140eb94d5f03c20237c.jpg

使用毕加索加载图像。

Picasso.with(MainActivity.this).load(url).into(profileImage);
Run Code Online (Sandbox Code Playgroud)

如何从url下载图片。将其保存在 sd 卡中的文件中,然后从文件中加载图像以显示在图像视图中?

请帮忙。谢谢..

sus*_*dlh 5

使用 GLIDE 库,它会自动将您的图像存储到缓存中 .....

   Glide.with(context).load(url).into(profileImage);
Run Code Online (Sandbox Code Playgroud)

注意:- 仅当您第一次需要互联网来加载图像时。当 Image 在没有互联网的情况下加载它的工作时。

编辑:-使用这个gradle

compile 'com.github.bumptech.glide:glide:3.7.0'
Run Code Online (Sandbox Code Playgroud)

输出:-

○