下载到内置存储器可能吗? [英] Download to internal memory possible?

查看:98
本文介绍了下载到内置存储器可能吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用 downloadmanager.request排队setDestinationUri 来 下载文件。

是否可以将文件下载到内部存储器位置 该设备在这里也可以是持续性的?

Is it possible to download the files to the internal memory location of the device where it can be persistent?

我使用的是Android 3.1的Xoom设备,它并没有真正有一个 它功能的SD卡,虽然应用程序可以让我们写的的/ mnt / SD卡位置。

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 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.

好像你有两个选择。

(1)供应的外部存储器,它完成的时候,拷贝到内置存储,然后删除外部存储上的文件的文件路径。

(1) Supply a file path on "external" storage, when it completes, copy to internal storage, and then delete the file on external storage.

(2)创建一个下载管理器可以写入并给它对应于此的ContentProvider的URI ContentProvider的。您实施的ContentProvider的可以将文件写入内部存储,因为它会在你的应用程序的环境中运行。

(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.

这篇关于下载到内置存储器可能吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆