常用存储路径操作
/**
* Environment API
*/
1.Environment.getRootDirectory()//系统目录 /system
2.Environment.getDataDirectory()//数据目录 /data
3.Environment.getDownloadCacheDirectory()//缓存目录 /cache
☆.Environment.getExternalStorageDirectory()//存储卡根目录 /storage/emulated/0
☆.Environment.getExternalStoragePublicDirectory("test/")//存储卡根目录 /storage/emulated/0/test
5.Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_ALARMS)//系统提醒铃声 /storage/emulated/0/Alarms
6.Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DCIM)//相机拍摄照片和视频 /storage/emulated/0/DCIM
7.Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOCUMENTS)//文档 /storage/emulated/0/Documents
8.Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS)//下载 /storage/emulated/0/Download
9.Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_MOVIES)//电影 /storage/emulated/0/Movies
10.Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_MUSIC)//音乐 /storage/emulated/0/Music
11.Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_NOTIFICATIONS)// 系统通知铃声 /storage/emulated/0/Notification
12.Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_PICTURES)//图片 /storage/emulated/0/Pictures
13.Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_PODCASTS)//系统广播 /storage/emulated/0/Podcasts
14.Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_RINGTONES)//系统铃声 /storage/emulated/0/Ringtones
ps:Environment.getExternalStorageState()//是否挂载外置存储卡 mounted
/**
* Context API
*/
1.context.getFilesDir()//应用内文件 /data/user/0/{pakageName}/files
2.context.getCacheDir()//应用内缓存 /data/user/0/{pakageName}/cache
3.context.getExternalFilesDir("")//应用外置卡的文件 /storage/emulated/0/Android/data/{pakageName}/files
4.context.getExternalCacheDir()//应用外置卡缓存 /storage/emulated/0/Android/data/{pakageName}/cache
Android系统根目录