Android:在存储 SD 卡上组织目录和文件的良好做法?

标签 android file resources storage sd-card

我的应用程序应该在哪里存储从互联网下载的资源文件,是否有任何指南?

最佳答案

这是一个建议 gleaned来自安卓开发者论坛:

There are two fairly common and well defined situations:

Situation: You need a temp file to do some processing that won't necessarily fit into memory.

Solution: Create the file, use it, delete it when you're done* Caveat: The file may be exceptionally large: demand an SDCard. The file contains sensitive information: use app storage.

Situation: You are operating a cache.

Solution: maintain the files in the supplied cache directory (Context.getCacheDir()), the system knows these can be deleted** Caveat: Big ticket items (like songs and videos) go to the sdcard (the user can treat these types as useful files anyway)

关于Android:在存储 SD 卡上组织目录和文件的良好做法?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2017598/

相关文章:

java - setOnTouchListener 和 setOnItemClickListener 不能同时工作

java.util.arraylist 无法转换为 java.lang.object[]

android - 如何访问Android手机中的所有铃声列表?

file - 是否有 BoxedApp SDK 的替代品?

python - CSV 文件创建问题

actionscript-3 - 如何以正确的方式在 Actionscript 3/Flex 3 中嵌入图像?

java - 错误的 R.java 绘图生成

android - Android 中的全局搜索是否仍然可供开发人员使用?

android - 如何检查 SQLite 文件一致性(健康检查)

python - 在 Windows 中限制 python 脚本 RAM 使用