Android-Dropbox:检查差异 [英] Android - Dropbox: Check for differences

查看:83
本文介绍了Android-Dropbox:检查差异的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以检查local和Dropbox之间的差异?

Is it possible to check for differences between local and Dropbox?

您好。我目前正在开发一个显示所有Dropbox图像的简单画廊应用程序。

Hello. I am currently working on a simple gallery App which displays all Dropbox images.

到目前为止的工作流程:
我登录到Dropbox。该应用程序以递归方式扫描所有Dropbox文件夹并检查图像,然后获取元数据并显示图像。

The workflow so far: I log into Dropbox. The App scans recursively through all Dropbox folders and checks for images, then takes the metadata and displays the images.

现在,我想知道是否可以检查差异因此,该应用程序无需每次都在所有文件夹中运行,而仅需进行某些更改(例如,将新图像添加到Dropbox文件夹中)。

Now I want to know if it is possible to check for differences so the App does not need to run through all folders every time but only if something has changed (for example if new images have been added to a Dropbox folder).

谢谢

推荐答案

在使用Dropbox API时,跟踪Dropbox帐户中更改的最佳方法是使用/ 2 / files / list_folder和/ 2 / files / list_folder / continue:

The best way to keep track of changes in a Dropbox account when using the Dropbox API is by using /2/files/list_folder and /2/files/list_folder/continue:

https://www.dropbox.com/developers/documentation/http/documentation#files-list_folder
https://www.dropbox.com/developers/documentation/h ttp / documentation#files-list_folder-continue

您应该存储最新返回的游标,然后使用以下命令回调到/ 2 / files / list_folder / continue该光标。

You should store the latest returned cursor, and then call back to /2/files/list_folder/continue using that cursor. It will returned only the changes since you last called.

对于客户端应用程序,您可以使用/ 2 / files / list_folder / longpoll高效地知道何时有更改检索:

For client-side apps, you can use /2/files/list_folder/longpoll to efficiently know when there are changes to retrieve:

https://www.dropbox.com/developers/documentation/http/documentation#files-list_folder-longpoll

也有相应的方法如果您使用的是SDK。例如,在 Dropbox Java API SDK v2 中,这些是 listFolder listFolderContinue listFolderLongpoll

There are also corresponding methods if you're using an SDK. For example, in the Dropbox Java SDK for API v2, these are listFolder, listFolderContinue, and listFolderLongpoll, respectively.

这篇关于Android-Dropbox:检查差异的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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