[SUG] Move cache directory to /Android/data
Posted: 2011-09-19, 23:11 UTC
It looks like the app keeps a cache directory for thumbnails in [face=courier]/.TotalCommander[/face] on the external storage volume. According to the documentation for Environment.getExternalStorageDirectory(), applications shouldn't use the top-level directory:
The Dev Guide recommends using Context.getExternalCacheDir(), which would be equivalent to [face=courier]/Android/data/com.ghisler.android.TotalCommander/cache[/face]. Since Context.getExternalCacheDir() was introduced in API Level 8, you may want to build the path manually:Applications should not directly use this top-level directory, in order to avoid polluting the user's root namespace.
Code: Select all
File externalCacheDir = new File(new File(new File(new File(Environment.getExternalStorageDirectory(), "Android"), "data"), context.getPackageName()), "cache");