欢迎使用CSDN-markdown编辑器

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]));
}
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值