发布:2023/12/7 15:19:44作者:大数据 来源:大数据 浏览次数:376
System.Environment.SpecialFolder.LocalApplicationData =/data/user/0/DocFileApp.DocFileApp/files/.local/share
System.Environment.SpecialFolder.Personal =/data/user/0/DocFileApp.DocFileApp/files
System.Environment.SpecialFolder.MyDocuments =/data/user/0/DocFileApp.DocFileApp/files
System.Environment.SpecialFolder.MyMusic= /data/user/0/DocFileApp.DocFileApp/files/Music
System.Environment.SpecialFolder.MyPictures =/data/user/0/DocFileApp.DocFileApp/files/Pictures
System.Environment.SpecialFolder.MyVideos =/data/user/0/DocFileApp.DocFileApp/files/Videos
System.Environment.SpecialFolder.MyMusic =/data/user/0/DocFileApp.DocFileApp/files/Music
以上用System.Environment.GetFolderPath(SpecialFolder枚举变量)方法获取结果,其实是获取的是手机内部存储目录,参数为空串不能为null:/data/user/0/package/=/data/data/package/
主要这个此文件夹除非root,否则只有自己可访问.用于存储一些私密的信息.如 App 中的 WebView 缓存页面信息,SharedPreferences 和 SQLiteDatabase 持久化应用相关数据等用户信息.会随者应用卸载而删除.
===============以下为常量字符串放在外部存储/storage/emulated/0/之后
Android.OS.Environment.DataDirectory.AbsolutePath =/data
Android.OS.Environment.DirectoryDcim =DCIM
Android.OS.Environment.DirectoryDocuments =Documents
Android.OS.Environment.DirectoryDownloads =Download
Android.OS.Environment.DirectoryMovies =Movies
Android.OS.Environment.DirectoryMusic =Music
Android.OS.Environment.DirectoryPictures =Pictures
Android.OS.Environment.DownloadCacheDirectory =/cache
Android.OS.Environment.ExternalStorageDirectory =/storage/emulated/0
Android.OS.Environment.ExternalStorageState =mounted
Android.OS.Environment.RootDirectory.AbsolutePath =/system
外部存储公有目录:
Android.OS.Environment.ExternalStorageDirectory=Android.OS.Environment.GetExternalStoragePublicDirectory("")=/storage/emulated/0/
若访问download文件夹则只能使用Android.OS.Environment.GetExternalStoragePublicDirectory(Android.OS.Environment.DirectoryDownloads)
外部存储私有目录:
GetExternalFilesDir("")=/storage/emulated/0/Android/data/DocFileApp.DocFileApp/files
安卓文件目录:
Android中的内部存储与外部存储 > https://www.jianshu.com/p/ad844547a43b
android中的文件操作详解以及内部存储和外部存储 http://www.jcodecraeer.com/a/anzhuokaifa/androidkaifa/2013/0923/1557.html
参考:
(0)Android系统目录结构介绍
https://www.jianshu.com/p/fb03312ac8bb
(1)Android文件存储目录结构
https://blog.csdn.net/luoguopeng/article/details/72832567
(2)Android 文件夹简单介绍
https://blog.csdn.net/a13069730106/article/details/54232810
---------------------
© Copyright 2014 - 2024 柏港建站平台 ejk5.com. 渝ICP备16000791号-4