如何使用Android应用程序中的Dropbox Core API从Dropbox获取所有图像(包括完整URL)? [英] How Should I get all images(including full URL) from Dropbox using Dropbox Core API in android app?

查看:339
本文介绍了如何使用Android应用程序中的Dropbox Core API从Dropbox获取所有图像(包括完整URL)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要在Dropbox上获取所有图像的完整URL(不仅是名称),因为我需要在Android应用中将图像显示为列表。

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核心API并按如下方式调用API:

I am using Dropbox core API and called API as following:

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

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

使用上面的命令,我列出了所有文件,也得到了文件名,但无法获取每个文件的完整URL。

Using above I got all the files listed and also got its name but couldn't get full URL of each file.

我们非常感谢您的帮助。

Any help is highly appreciated.

预先感谢。

推荐答案

这取决于您究竟需要执行什么操作,以及您是否实际需要一个URL,如果需要,则取决于哪种URL。

This depends on what exactly you need to do, and if you actually need a URL, and if so, what kind of URL.

如果您只需要图片文件的内容,则应使用 getFile getFileStream 方法来访问实际文件内容并根据需要显示。

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.

如果您实际上需要直接访问文件内容的URL,则可以使用 media 获取网址。请注意,这些内容将在四个小时后失效。

If you actually need a direct URL to the file contents, you can use media to get the URL. Note that these expire after four hours though.

如果您需要寿命更长的URL(例如,用于共享),则可以使用 份额 。 (您还可以针对其他行为修改这些链接,如此处所示。)

If you need a longer-lived URL, e.g., for sharing, you can get the (preview) URL by using share. (You can also modify these links for other behaviors as shown here.)

这篇关于如何使用Android应用程序中的Dropbox Core API从Dropbox获取所有图像(包括完整URL)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆