Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Are there any guidelines where should my app store resource files downloaded from internet?

like image 515
tomash Avatar asked Jan 07 '10 01:01

tomash


People also ask

What are the three ways of storing data in Android application?

Android provides many kinds of storage for applications to store their data. These storage places are shared preferences, internal and external storage, SQLite storage, and storage via network connection.


1 Answers

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)

like image 85
Jacques René Mesrine Avatar answered Sep 27 '22 18:09

Jacques René Mesrine