jay jay - 15 days ago 9
Android Question

FileUtils.copyURLToFile not working with low internet speeds

I am using apache commons-io

FileUtils
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
Answer

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.