Xamarin Forms,Android 11+,rote中的访问音乐文件夹
嗨,我搜索并搜索了。
如何访问Android中的音乐文件夹? 不是该应用程序的音乐文件夹。
Android.os不可用。
我什至尝试了system.io.directory.getFiles(“/”);无许可。
我检查了陈述存储或阅读的清单中的所有许可。
我需要每个音频文件的filepath才能播放它。我不需要用户选择文件的文件对话框。
我需要root Music Dir中所有音频文件的字符串[]而不是应用程序。
必须有一种方法,因为存在音频播放器可以访问我的根部音乐文件夹。
不是 sdcard存储
Hi i searched and searched.
How do i access the music folder in android? Not the music folder of the app.
Android.OS is not available.
I even tried System.IO.Directory.GetFiles("/"); no permissions.
I checked every permission in the manifest that states storage or read.
I need the filepath to each audio file to be able to play it. I don't need a file dialog where the user chooses a file.
I need a string[] of all audio files in the root music dir not the app dir.
There has to be a way, cause audio players exist that access my root music folder.
NOT sdCard Storage
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
可能是您可以尝试授予您的应用程序访问所有文件的权限。
首先,将权限添加到AndroidManifest.xml中:
然后将以下代码添加到主要活动的on Create方法中以请求许可。
May be you can try to grant your app the permission about accessing all the files.
At first, add the permission into the AndroidManifest.xml:
And then add the following code into the OnCreate method of the main activity to request the permission.