Want to know more about Dash? Check out how Amy uses Dropbox and Dash to make her day easier here!
Forum Discussion
Muneebzzzz
7 years agoExplorer | Level 4
Dropbox api Data loading slowly
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 load...
Greg-DB
Dropbox Community Moderator
7 years agoAre 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.
Muneebzzzz
7 years agoExplorer | 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
- Greg-DB7 years ago
Dropbox Community Moderator
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?
- Muneebzzzz7 years agoExplorer | 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
- Greg-DB7 years ago
Dropbox Community Moderator
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.
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.6,019 PostsLatest Activity: 2 days ago
The Dropbox Community team is active from Monday to Friday. We try to respond to you as soon as we can, usually within 2 hours.
If you need more help you can view your support options (expected response time for an email or ticket is 24 hours), or contact us on X or Facebook.
For more info on available support options for your Dropbox plan, see this article.
If you found the answer to your question in this Community thread, please 'like' the post to say thanks and to let us know it was useful!