The fact is that I use the library to download files. By default, all downloaded files are saved in the Downloads folder of the internal memory of the phone. Everywhere it says that you can write files to the SD-карту in this way:

 Environment.getExternalStorageDirectory() + File.separator 

Yes, and in the README also writes about this:

 .destinationFilePath(Environment.getExternalStorageDirectory() + File.separator) 

But no matter how it changed, it still writes the downloaded files to the internal memory. Only not in the Downloads , but in the root.

Tell me, please, what am I doing wrong?

  • Stupid idea, but you wrote the permission in the manifesto? - QuaternioNoir
  • Yes of course .... - DevOma

1 answer 1

The documentation says that for destinationFilePath you need to set the path including the file name:

 String destPath = Environment.getExternalStorageDirectory() + File.separator + "test.apk"; 

If you do not want to set the file name, you must use another method:

 destinationDirectory(String directory) 
  • It also tried. It is still created in the internal folder - DevOma
  • Then write a bug to the author of the library. - Eugene Krivenja