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: 

Re: [Android] Effective way to download files

[Android] Effective way to download files

NewUser
New member | Level 2
Go to solution

Hi. In my app I need to download a lot of small files (0.1 - 5MB). For example now I have got 50 files and I download them by using this code foreach: 

 

FileOutputStream fOut = null;
File file = new File(localPATH, localName);
if (file.exists())
      file.delete();
file.createNewFile();
fOut = new FileOutputStream(file);
dbxClient.files().downloadBuilder(remotePATH).start().download(fOut);
fOut.flush();
fOut.close();

But I think this way isn't good. Download process take from 1 to 2.5 minutes (size of all files = 8MB, my internet speed = 40Mbps).

Can someone tell me what should I use for increase download speed?

Thanks for answers.

 

1 Accepted Solution

Accepted Solutions

Greg-DB
Dropbox Staff
Go to solution

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. 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. The API can't offer a way to control that unfortunately.

 

That said, in your case, the effective speed you're seeing may be due to the fact that you're trying to download many smaller files. In this example, you need to make 50 distinct API calls, each of which comes with some amount of overhead, reducing the overall speed. Unfortunately, the API doesn't offer a good solution to that, but I'll be sure to pass this along as a feature request for a batch download call.

View solution in original post

1 Reply 1

Greg-DB
Dropbox Staff
Go to solution

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. 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. The API can't offer a way to control that unfortunately.

 

That said, in your case, the effective speed you're seeing may be due to the fact that you're trying to download many smaller files. In this example, you need to make 50 distinct API calls, each of which comes with some amount of overhead, reducing the overall speed. Unfortunately, the API doesn't offer a good solution to that, but I'll be sure to pass this along as a feature request for a batch download call.

Need more support?