简体   繁体   中英

Android: good practices for organizing dirs and files on storage SD card?

我的应用程序存储从Internet下载的资源文件有什么指导吗?

Here is an advice gleaned from the android developers forum:

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)

为了将来参考,现在已发布指南: http//developer.android.com/guide/topics/data/data-storage.html

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM