I am using downloadmanager.request enqueue setDestinationUri to
download files.
Is it possible to download the files to the internal memory location
of the device where it can be persistent?
I am using Android 3.1 Xoom device and it does not really have a
functional SD card on it though the app allows us to write to /mnt/
sdcard location.
Any way of storing downloaded file onto internal memory?
TIA
It is unlikely that
DownloadManagerwill be able to do this. My assumption is thatDownloadManagerdoes not run in your process, but in another process controlled by the system. Internal storage locations are permissions protected and any location that you would provide would be accessible only to your application.It seems like you have two options.
(1) Supply a file path on “external” storage, when it completes, copy to internal storage, and then delete the file on external storage.
(2) Create a
ContentProviderwhichDownloadManagercan write to and give it aURIthat corresponds to thisContentProvider. TheContentProviderthat you implement can write the file to internal storage since it will run in the context of your application.