Android开发获取常用文件夹
KLog.d(Common.ljq, "getCacheDir:" + getCacheDir());
KLog.d(Common.ljq, "getFilesDir:" + getFilesDir());
KLog.d(Common.ljq, "getObbDir:" + getObbDir());
KLog.d(Common.ljq, "getExternalCacheDir:" + getExternalCacheDir());
KLog.d(Common.ljq, "Environment.getRootDirectory:" + Environment.getRootDirectory());
KLog.d(Common.ljq, "Environment.getExternalStorageState:" + Environment.getExternalStorageState());
KLog.d(Common.ljq, "Environment.getExternalStorageDirectory:" + Environment.getExternalStorageDirectory());
KLog.d(Common.ljq, "Environment.getDataDirectory:" + Environment.getDataDirectory());
KLog.d(Common.ljq, "Environment.getDownloadCacheDirectory:" + Environment.getDownloadCacheDirectory());
KLog.d(Common.ljq, "Environment.DIRECTORY_ALARMS:" + Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_ALARMS));
KLog.d(Common.ljq, "Environment.DIRECTORY_PICTURES:" + Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_PICTURES));
KLog.d(Common.ljq, "Environment.DIRECTORY_DCIM:" + Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DCIM));
KLog.d(Common.ljq, "Environment.DIRECTORY_DOCUMENTS:" + Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOCUMENTS));
KLog.d(Common.ljq, "Environment.DIRECTORY_DOWNLOADS:" + Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS));
KLog.d(Common.ljq, "Environment.DIRECTORY_MOVIES:" + Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_MOVIES));
KLog.d(Common.ljq, "Environment.DIRECTORY_MUSIC:" + Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_MUSIC));
KLog.d(Common.ljq, "Environment.DIRECTORY_NOTIFICATIONS:" + Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_NOTIFICATIONS));
KLog.d(Common.ljq, "Environment.DIRECTORY_PODCASTS:" + Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_PODCASTS));
KLog.d(Common.ljq, "Environment.DIRECTORY_RINGTONES:" + Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_RINGTONES));
File[] files = ContextCompat.getExternalFilesDirs(this, null);
for (int i = 0, count = files.length; i < count; i++) {
KLog.d(Common.ljq, UtilString.getString("External File %d:%s", i, files[i]));
}
files = ContextCompat.getExternalCacheDirs(this);
for (int i = 0, count = files.length; i < count; i++) {
KLog.d(Common.ljq, UtilString.getString("External Cache %d:%s", i, files[i]));
}