简体   繁体   English

如何使用Android应用程序中的Dropbox Core API从Dropbox获取所有图像(包括完整URL)?

[英]How Should I get all images(including full URL) from Dropbox using Dropbox Core API in android app?

I need to get all the images on Dropbox with its full URL(not only name) as I need to display images as a list in my android app. 我需要在Dropbox上使用其完整URL(不仅是名称)获取所有图像,因为我需要在Android应用中将图像显示为列表。

I am using Dropbox core API and called API as following: 我正在使用Dropbox核心API,并按以下方式调用API:

DropboxAPI.Entry existingEntry= mDBApi.metadata("/", 1000, null, true, null); DropboxAPI.Entry existingEntry = mDBApi.metadata(“ /”,1000,null,true,null);

Using above I got all the files listed and also got its name but couldn't get full URL of each file. 使用上面的命令,我列出了所有文件,并获得了文件名,但无法获取每个文件的完整URL。

Any help is highly appreciated. 非常感谢您的帮助。

Thanks in advance. 提前致谢。

This depends on what exactly you need to do, and if you actually need a URL, and if so, what kind of URL. 这取决于您到底需要做什么,是否实际需要一个URL,如果需要,则取决于哪种URL。

If you just need the content of the image files, you should use the getFile or getFileStream method to access the actual file content and display it as desired. 如果只需要图像文件的内容,则应使用getFilegetFileStream方法访问实际文件内容并根据需要显示它。

If you actually need a direct URL to the file contents, you can use media to get the URL. 如果您实际上需要指向文件内容的直接URL,则可以使用media获取URL。 Note that these expire after four hours though. 请注意,它们会在四个小时后过期。

If you need a longer-lived URL, eg, for sharing, you can get the (preview) URL by using share . 如果您需要更长寿的URL(例如,用于共享),则可以使用share获得(预览)URL。 (You can also modify these links for other behaviors as shown here .) (您也可以修改这些链接的其他行为如图所示这里 。)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM