Android:将外部存储器上的文件夹设为私有(private)或 protected

标签 android memory directory external private

我想将外部存储器(可能在 SD 卡上)上的文件夹设为私有(private)或 protected ,以便只有我的应用程序/进程可以访问该文件夹。

我可以这样做吗?如果是,请告诉我?

我的要求: 我可以使用 android 的内存来存储我的应用程序的文件/数据,但这可能会减少手机的内存(这可能会导致诸如没有足够的空间安装其他应用程序等问题)

最佳答案

外部存储上的数据不能是私有(private)的。它是全局可读的,如果用户启用 USB 大容量存储,则可以由用户更改。

引自 developer.android.com:

Every Android-compatible device supports a shared "external storage" that you can use to save files. This can be a removable storage media (such as an SD card) or an internal (non-removable) storage. Files saved to the external storage are world-readable and can be modified by the user when they enable USB mass storage to transfer files on a computer.

关于Android:将外部存储器上的文件夹设为私有(private)或 protected ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9328409/

相关文章:

android - 使用加载程序管理器读取联系人

java - 如果仍然引用某个对象的属性之一,该对象是否保留在内存中?

c# - ASP.NET "Sessions Timed Out"计数器 (perfmon.exe)

java - Netbeans - 是否可以在树(分层) View 而不是平面 View 中查看项目源文件夹?

android - 滑动图表引擎 fragment 有点滞后

android - 从 web .vcs 下载将日历事件添加到 Android

android - 何时使用自定义 CursorLoader?

memory - Golang, fatal error : out of memory on 1 TB RAM machine

安卓工作室 : Inserting files into the Assets folder

php - 有没有办法在 Windows 和 Linux 上使用 php 检测文件夹中的更改?