cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Want to learn some quick and useful tips to make your day easier? Check out how Calvin uses Replay to get feedback from other teams at Dropbox here.

Dropbox API Support & Feedback

Find help with the Dropbox API from other developers.

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

delta equivalent for Core API v2

delta equivalent for Core API v2

Billy S.
New member | Level 1

I wonder if the following is the right way to detect remote changes in Java/Android using Core API v2:

ListFolderGetLatestCursorResult cursor = client.files().listFolderGetLatestCursor("");
ListFolderResult result = client.files().listFolderContinue(cursor.getCursor());

for (Metadata metadata : result.getEntries()) {
...
}

However I have not been able to detect remote folder changes with the above logic (if I use listFolder(), that works but it appears also the loop would visit every single file).  Or should I keep cursor in persistent storage like SharePreferences?

Thanks in advance.

4 Replies 4

Greg-DB
Dropbox Staff

The equivalent of v1's getDelta (without a cursor) is listFolder, and the equivalent of getDelta (with a cursor) is listFolderContinue. Likewise, the equivalent of getDeltaLatestCursor is listFolderGetLatestCursor.

If you want the full state of the files in the account, you should start with listFolder (as opposed to listFolderGetLatestCursor) and continue on with listFolderContinue.

If you only want new changes, and don't care about existing items, then you can use listFolderGetLatestCursor and listFolderContinue.

In either case, you do need to store the last cursor you received (e.g., from listFolderContinue), and use that when calling back to listFolderContinue again. If you get the latest cursor from listFolderGetLatestCursor each time though, you won't see changes that occurred in the interim.

Billy S.
New member | Level 1

Thanks for the clarification.

BCKI
New member | Level 2

It seems like in v1 /delta returned ANY new changes in the entire Dropbox, while in v2 it is only able to see a specified folder path. Am I not understanding something here? 

BCKI
New member | Level 2

I figured it out, thanks to this thread: https://www.dropboxforum.com/t5/API-support/list-folder-continue-Always-empty/td-p/164977 (Steve M.)

 

I forgot to send the recursive parameter.

 

🙂

Need more support?
Who's talking

Top contributors to this post

  • User avatar
    BCKI New member | Level 2
  • User avatar
    Billy S. New member | Level 1
  • User avatar
    Greg-DB Dropbox Staff
What do Dropbox user levels mean?