Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Download to internal memory possible?

Tags:

android

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

like image 689
VJ Vélan Solutions Avatar asked Jun 27 '11 14:06

VJ Vélan Solutions


People also ask

What is internal download storage?

Android Internal storage is the storage of the private data on the device memory. By default, saving and loading files to the internal storage are private to the application and other applications will not have access to these files.

Is it possible to increase internal storage?

To substantially increase your phone's memory, you can transfer data to an Secure Digital (SD) card. Other quick options include removing cached data and large downloads, temporarily disabling apps, and removing photos and videos.

How can I download a file greater than 4GB to a smartphone?

Please make sure that your storage location is saved as an SD card in the settings in our app. If you want to download files larger than 4GB, please change the storage location to internal storage or please transfer after dividing files smaller than 4GB. Then you will be able to download them.


1 Answers

It is unlikely that DownloadManager will be able to do this. My assumption is that DownloadManager does 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 ContentProvider which DownloadManager can write to and give it a URI that corresponds to this ContentProvider. The ContentProvider that you implement can write the file to internal storage since it will run in the context of your application.

like image 77
cyngus Avatar answered Oct 05 '22 07:10

cyngus