jay jay - 5 months ago 50
Android Question

FileUtils.copyURLToFile not working with low internet speeds

I am using apache commons-io

for downloading a file into android device from given url.

FileUtils.copyURLToFile(new URL(urlString), tempFolderFile)

This works very well under normal internet speeds, but does not work at all under 2G internet speed (1kB/sec).

Is this a limitation with apache commons-io library or is there a way to achieve download with this library ?

jay jay

Buffersize will not impact much. It should be maintained within safe limit, library will take care of it. 2G internet speeds vary from 10-20 kbps. Make sure timeout is sufficiently high to download the file.