简体   繁体   中英

Android - Dropbox: Check for differences

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

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

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.

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).

Thank you in advance.

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/http/documentation#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.

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

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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