Internal Path
Environment.getdatadirectory () =/data
Environment.getdownloadcachedirectory () =/cache
Environment.getrootdirectory () =/system
Context.getcachedir () =/data/data/com.penngo.test/cache
Context.getfilesdir () =/data/data/com.penngo.test/files
Memory card Path
Environment.getexternalstoragedirectory () =/storage/sdcard0
Selectable values Directory_music, directory_podcasts, Directory_ringtones,
Directory_alarms, Directory_notifications, Directory_pictures,
Directory_movies, Directory_downloads, or DIRECTORY_DCIM. Cannot be null
Environment.getexternalstoragepublicdirectory (Environment.directory_music) =/storage/sdcard0/music
As with Context.getfilesdir (similar to deleting an app, it is deleted at the same time
Context.getexternalfilesdir () =/storage/sdcard0/android/data/com.penngo.test/files
Similar to Context.getcachedir (), deleting an app deletes it at the same time
Context.getexternalcachedir () =/storage/sdcard0/android/data/com.penngo.test/cache
System.getproperty ("user.home") =
System.getproperty ("Java.io.tmpdir") =/data/data/com.penngo.test/cache
New File (). GetAbsolutePath () =/.
Determine if a memory card exists
public static Boolean issdcardexist () {
if (Environment.getexternalstoragestate (). Equals (
environment.media_mounted)) {//Determine if the mount is already mounted
return true;
}
return false;
}
Android Path acquisition