im building an android app and i need to save some files locally on the SD card. The question i want to ask is that does the android OS clear the app cache
mnt/sdcard/Android/data/app_name/cache/*
get cleared after the app is closed by the os due to lack of memory ( sigkill sent) ?
In what conditions or when is the cache cleared. If the app needs to save some file safely where should it store them?
get cleared after the app is closed by the os due to lack of memory ( sigkill sent) ?
ReplyDeleteIt should not be cleared in that case.
In what conditions or when is the cache cleared.
Definitely when the user elects to clear it, or when the app is uninstalled. The external cache directory is not automatically cleared due to low storage conditions.
If the app needs to save some file safely where should it store them?
That depends on your definition of "safely".
FC doesn't clear your cache. FC means that your app's process is killed. So it doesn't affect the cache
ReplyDeleteyour app's cache is cleared when you manually select clear data and clear cache under Managing Applications in Settings
For a safe storage, use your external storage. External storage is usually much bigger than the internal storage. (Here safe means, avoid frequently running out of space as compared to internal storage)