我的应用程序应该在哪里存储从互联网下载的资源文件,是否有任何指南?
最佳答案
这是一个建议 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/