Android app File save directory can be the app's built-in private directory, of course, you can also choose the external sdcard directoryBuilt-in private directory
/data/data/[packagename]/files file cache directory, generally save small file cache, if it is a picture, do not suggest put here, generally put to external card.
File File = Getfilesdir (); Return to this directory
Write files to this directory can be like this
FileOutputStream fos = null; try { fos = appontext.openfileoutput (name, context.mode_private); Fos.write (Content.getbytes ()); } catch (Exception e) { }finally{ try { if (null! = Fos) { fos.close () } } catch (Exception e) { } }
/data/data/[packagename]/cache directory, storing some other cached File cache = Getcachedir ();
/data/data/[packagename]/databases, storing the database
/data/data/[packagename]/lib, application of So directory
Sharedpreferences Save for/data/data/[packagename]/shared_prefs applications
Can I create a different directory on my own? OK
Use File Owndatapath = Getdir ("service", context.mode_private);
Use it to create a app_service directory, put what you define
External SDcard Directory
External Cache directory (File sdcache = Getexternalcachedir ();)
/storage/emulated/0/android/data/[packagename]/cache
Some of the less important caches or large files are put here, compared to the slice cache
The external File cache directory (File Sdfile = Getexternalfilesdir (null);),
/storage/emulated/0/android/data/[packagename]/files
Some of the less important file caches or large files are put here
Note:/storage/emulated/0/android/data/[packagename] After android2.2, it will be uninstalled after the app is uninstalled. So there is no need to clean up the cache with what the software cleans.
PS: Now the phone supports external Mount T card, how to access the external T card directory?
- can refer to!http://stackoverflow.com/questions/5694933/find-an-external-sd-card-location
File save directory for Android app