System.out.println(Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_ALARMS));
System.out.println(Environment.getExternalStorageDirectory());
System.out.println(Environment.getDownloadCacheDirectory());
System.out.println(Environment.getRootDirectory());
System.out.println(Environment.getExternalStorageState());
结果:
I/System.out: /dataI/System.out: /storage/emulated/0/Alarms
I/System.out: /storage/emulated/0
I/System.out: /cache
I/System.out: /system
I/System.out: mounted
System.out.println(getCacheDir());
System.out.println(getDataDir());
System.out.println(getFilesDir());
System.out.println(getExternalCacheDir());
System.out.println(getCodeCacheDir());
System.out.println(getNoBackupFilesDir());
System.out.println(getExternalMediaDirs()[0]);
System.out.println(getExternalFilesDir(Environment.DIRECTORY_DOWNLOADS));
结果:
/data/user/0/com.mu.example.myapplication/cache
/data/user/0/com.mu.example.myapplication
/data/user/0/com.mu.example.myapplication/files
/storage/emulated/0/Android/data/com.mu.example.myapplication/cache
/data/user/0/com.mu.example.myapplication/code_cache
/data/user/0/com.mu.example.myapplication/no_backup
/storage/emulated/0/Android/media/com.mu.example.myapplication
/storage/emulated/0/Android/data/com.mu.example.myapplication/files/Download