drulabs
drulabs

Reputation: 3121

dropbox sdk- Get all file metadata lazily in android client

I am integrating dropbox in my android application. The requirement is to get all file metadata. I have downloaded dropbox sdk and I am able to authenticate user's credentials as well.

I am unable to get all files using this. this provides metadata of only root folder contents

    mDBApi.metadata("/", 0, null, true, null);

I need to chain the api calls to get metadata of all files and folders. Now I want to do it lazily, like get 100 files, dump the metadata in local cache and get next 100 files metadata (irrespective of file location, i.e. no matter where the file is, in root or under 10 folders)

I am using "AccessType.DROPBOX" access to get all the contents. I know that there is a parameter for specifying how many files to fetch in one go ("0" in the above statement) but I want to keep fetching metadata till all data has been received in my client. Is there a way for this or a sample code may be.

Thanks.

Upvotes: 1

Views: 1185

Answers (1)

Greg
Greg

Reputation: 16940

The Dropbox API metadata call is meant only for retrieving a single file or folder's metadata. The best practices page indicates that you should not recursively call this endpoint:

https://www.dropbox.com/developers/reference/bestpractice

You may instead be interested in using the delta call to build and maintain your local state:

https://www.dropbox.com/developers/core/api#delta

Upvotes: 1

Related Questions