cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Back again with another edition of 'How we use Dropbox', so find out how Emma uses to-do lists to get it all done 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

Re: delta equivalent for Core API v2

Greg-DB
Dropboxer

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.

Re: delta equivalent for Core API v2

Billy S.
New member | Level 1

Thanks for the clarification.

Re: delta equivalent for Core API v2

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? 

Re: delta equivalent for Core API v2

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.

 

🙂

Poll
We love to learn from the educators who use Dropbox. Whether you teach kids, teens, adults or a combination of all three, we want to know what apps and integrations you use with Dropbox to help with teaching. Which of the ones below is your favorite, or most used tool?
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 Dropboxer
What do Dropbox user levels mean?
Need more support?