开发者

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

Are there any guidelines where shou开发者_如何转开发ld my app store resource files downloaded from 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)


For future reference, now there are published guidelines: http://developer.android.com/guide/topics/data/data-storage.html

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜