Android 路径目录相关

2019-03-27  本文已影响0人  yunhen

先说下应用管理里的清除数据和清除缓存:

清除数据,会清除以下目录: /data/data/包名/
清除缓存,会清除以下目录: /data/data/包名/cache


getFilesDir  =[/data/user/0/cn.yunhen.toastutils/files]

getCacheDir  =[/data/user/0/cn.yunhen.toastutils/cache]

getObbDir  =[/storage/emulated/0/Android/obb/cn.yunhen.toastutils]

getExternalCacheDir  =[/storage/emulated/0/Android/data/cn.yunhen.toastutils/cache]

getExternalFilesDir(Environment.DIRECTORY_DOWNLOADS)  =[/storage/emulated/0/Android/data/cn.yunhen.toastutils/files/Download]

Environment.getExternalStorageDirectory()  =[/storage/emulated/0]

Environment.getDataDirectory() =[/data]


File[] files =context.getExternalFilesDirs(null);
 files[0] = /storage/emulated/0/Android/data/cn.yunhen.toastutils/files(内置卡)
 files[1]  = /storage/5244-488A/Android/data/cn.yunhen.toastutils/files(外置sd卡)

上一篇 下一篇

猜你喜欢

热点阅读