android 设置和获取路径

来源:互联网 发布:2017广州qt场及js汇总 编辑:程序博客网 时间:2024/06/06 04:45

如何android 获取系统默认路径

转自:http://blog.csdn.net/zhengdan66/article/details/8930252

Environment.getDataDirectory().getPath(): /data
Environment.getDownloadCacheDirectory().getPath()  : /cache
Environment.getExternalStorageDirectory().getPath(): /mnt/sdcard
Environment.getRootDirectory().getPath()           : /system
Context.getCacheDir().getPath()                    : /data/data/com.zhd/cache
Context.getExternalCacheDir().getPath()            : /mnt/sdcard/Android/data/com.zhd/cache
Context.getFilesDir().getPath()                    : /data/data/com.zhd/files
Context.getObbDir().getPath()                      : /mnt/sdcard/Android/obb/com.zhd
Context.getPackageName()                           : com.zhd
Context.getPackageCodePath()                       : /data/app/com.zhd-1.apk
Context.getPackageResourcePath()                   : /data/app/com.zhd-1.apk



设置文件存储路径

转自:http://www.jianshu.com/p/3e1467c05acf

http://blog.csdn.net/u012547790/article/details/47300923?locationNum=2&fps=1

1.setDestinationInExternalFilesDir

2.setDestinationToSystemCache

3.setDestinationUri


原创粉丝点击