cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Tell us what you want to see on the Community here!
Close

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: 

Dropbox api Data loading slowly

Highlighted

Dropbox api Data loading slowly

Explorer | Level 4

I have developed an android app which uses Dropbox sdk. iam fetching my data on my loading screen on app, it worked fine when my data was small on my dropbox.. now i have purchased a dropbox and loaded GB's of audio files and images.. now it took 3 minutes to fetch data on my app.. i dont upload anything from my android app..only download.. please help me regarding this that how can i improve this speed

5 Replies 5
Highlighted

Re: Dropbox api Data loading slowly

Dropboxer

Are you referring to the actual transfer speed you're seeing when trying to download a single large file? Your connection speed to Dropbox depends on the routing you get between your ISP and our servers, and may be slower than your ISP's rated speeds. The Dropbox API doesn't offer a way to control the speed; it will just try to run as fast as possible.

Sometimes resetting or retrying your connection gets you a different route and better speeds, but that is outside of our control. Some ISPs also throttle sustained connections so if you see an initial high connection speed followed by lower speeds, that could be the reason.

Highlighted

Re: Dropbox api Data loading slowly

Explorer | Level 4

I have a data of approx 50GB on my dropbox which contains audio files. Audio files are small in size but are many. When i launch my mobile (android) application which i have made, i takes nearly 3 minutes to fetch data and show it on screen then i proceed further to interact with audio files to download.. downloading doesnot take time but at the initial start of my application, it takes much time to fetch data to my app

Highlighted

Re: Dropbox api Data loading slowly

Dropboxer

Thanks, so you mean it's not the actual file data download that's slow, but rather it's loading the file metadata that's slow? Can you share the code that's running during the slow part so we can take a look?

Highlighted

Re: Dropbox api Data loading slowly

Explorer | Level 4

yes its the file metadata that is loading slowly. 

below is my code which uses access token to link my users to my dropbox. 

ListFolderTask object takes much time to get data and then set to adpater

 

Highlighted

Re: Dropbox api Data loading slowly

Dropboxer

Thanks! First, I see that you're using listFolder to list the contents of folders. That's the correct method, but note that you also need to use listFolderContinue, as you're not guaranteed to get all of the results back in a single call to listFolder. Please review the listFolder documentation for more information. 

Anyway, you can't directly control the performance of listFolder, but it looks like you may be calling it more than necessary. 

For instance, I see that you're calling it initially here, but are never actually using the result: (at least in the code you shared)

 

temp = client.files().listFolder("");

If you don't need that call, you should remove it, which would reduce the overall execution time.

 

Then, I see that you're implementing your own recursive functionality by calling listFolder again for each sub-folder (and so on) here:

ListFolderResult subResult = client.files().listFolder(result.getEntries().get(i).getPathLower());
HandleEntries(subResult);

Depending on your scenario, it may be better to use the Dropbox native 'recursive' listFolder functionality. You can do so by getting a ListFolderBuilder from listFolderBuilder, and calling ListFolderBuilder.withRecursive to set 'recursive' to true. If you use that instead of your initial listFolder call (and subsequent manual recursive calls), Dropbox will automatically give you all of the nested entries. Again though, be sure to read the documentation for information on how to properly implement this.

Work Smarter with Dropbox

The way we work is changing. Share and discover new ways to work smarter with Dropbox in our community.

Sound good? Let's get started.
Who's talking

Top contributors to this post

What do Dropbox user levels mean?
Need more support?