Android Picasso Dropbox:如何将图像加载到gridview中
16lz
2021-01-22
- I'm using Dropbox Android SDK for getting photos and show it into a GridView.
- Currently, I'm using Picasso for adapter with another images resources like GPhotos, Facebook... too.
How can I get downloadable link from Dropbox's file? Or How to use Picasso load Dropbox's image?
This is the way I get the Dropbox image:如何从Dropbox的文件中获取可下载的链接?或者如何使用Picasso加载Dropbox的图像?这是我获取Dropbox图像的方式:
List<Entry> listEntry = mApi.search("/photos", ".jpg", 0, false); int i = 0; for (Entry entry : listEntry) { if (this.isRemoving()) { // Check if fragment is being removed return; } if (!entry.isDir) { // Check if this entry is dir or file i++; Log.e(TAG, entry + " --- " + entry.fileName() + " --- " + entry.parentPath() + " --- " + entry.modified); final DropboxLink shareLink = mApi.share(entry.parentPath() + entry.fileName()); url = shareLink.url; Log.v(TAG, "shareLink: " + shareLink.url); // The file name I get is ImageName.JPG and path is /Photos // With share() the url I get looks like https://db.tt/xxxxxxxx } }
我正在使用Dropbox Android SDK获取照片并将其显示到GridView中。
目前,我正在使用毕加索作为适配器与另一个图像资源,如GPhotos,Facebook ......。
3 个解决方案
#1
0
I can't offer insight about using Picasso, but if you can accept the file data directly, using getFile
or getThumbnail
instead of share
would be better.
我无法提供有关使用Picasso的见解,但如果您可以直接接受文件数据,则使用getFile或getThumbnail而不是share会更好。
If you do need a URL that Picasso can directly download from, you should use the media
method instead.
如果您确实需要Picasso可以直接下载的URL,则应使用媒体方法。
更多相关文章
- OpenCV4Android中图像预览旋转90度的问题
- Android图形图像处理之Bitmap和BitmapFactory
- 使用android的加速度计移动图像
- 作物形象与毕加索相一致。
- 在不同状态下使用两个图像切换按钮
- POST json和图像到服务器android
- Java实现图像对比类
- 为可执行文件夹提供自定义图像
- 在扑克游戏中显示卡片的图像