我想将外部存储器(可能在 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/