在 Android 11 上正确查询 MediaStore 记录
我正在努力为我的音频/视频播放器应用提供 Android 11 支持。我主要担心的是,实际上,不要激怒 Google 部落,因为他们不允许播放器应用程序拥有所有文件访问
权限。我不希望我的应用程序在 Google 商店上发布时被拒绝。
在以前的 API 中,我使用的是 WRITE_EXTERNAL_STORAGE
权限,包括 Android 10(我在其中选择退出范围存储)。不过,我不知道如何处理 Android 11,而不会让我的应用程序在 Google 商店上发布时被拒绝。我了解到查询 MediaStore
记录需要 READ_EXTERNAL_STORAGE
权限,并且我有以下问题:
- 在 Android 11 上运行时会要求
READ_EXTERNAL_STORAGE
谷歌可以接受(当我在他们的商店发布我的应用程序时)? - 我是否可以为所有 API 请求运行时的
WRITE_EXTERNAL_STORAGE
权限,而不是READ_EXTERNAL_STORAGE
,并且 Android 11 设备上的系统会将此权限替换为READ_EXTERNAL_STORAGE
?需要在 Android 11 设备上添加要求READ_EXTERNAL_STORAGE
的条件。 - Google 可以接受在 Android 11 上运行时请求
WRITE_EXTERNAL_STORAGE
(当我在他们的商店中发布我的应用时)吗?
I am working on providing Android 11 support on my audio/video player app. My main concern is actually with not provoking the Google tribe with their no All files access
permission allowed for player apps. I do not want my app to be rejected on publishing on the Google store.
In previous APIs, I am using WRITE_EXTERNAL_STORAGE
permission including Android 10 (where I opt out off Scoped Storage). Though, I do not know how to handle Android 11 without having my app rejected on publishing on Google store. I have learned that READ_EXTERNAL_STORAGE
permission is needed for querying MediaStore
records and I have the following questions:
- Will asking for
READ_EXTERNAL_STORAGE
on runtime on Android 11 be acceptable with Google (when I publish my app on their store)? - Can I ask for
WRITE_EXTERNAL_STORAGE
permission on runtime instead ofREAD_EXTERNAL_STORAGE
for all APIs and the system on Android 11 devices would substitute that forREAD_EXTERNAL_STORAGE
or will I need to add conditions where I ask forREAD_EXTERNAL_STORAGE
on Android 11 devices. - Will asking for
WRITE_EXTERNAL_STORAGE
on runtime on Android 11 be acceptable with Google (when I publish my app on their store)?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以使用所有这些权限,而不会受到 Google 的任何禁止。你不能/不应该使用
MANAGE_EXTERNAL_STORAGE
,这是专门用于范围存储和文件管理应用程序、防病毒软件和其他“特权”软件的新权限you may use all these permissions without any ban from Google. you can't/shouldn't use
MANAGE_EXTERNAL_STORAGE
, new perm dedicated for Scoped Storage and file managing apps, antivirs and other "privileged" soft这是获取所有视频列表的函数
有趣的 getVideo():ArrayList {
}
2.这是所有 [源代码]1 用于视频播放器项目
Here is function for getting list of all video
fun getVideo():ArrayList {
}
2.Here is all [source code]1 for video player project