Android 11 Scoped 存储权限 [英] Android 11 Scoped storage permissions

查看:28
本文介绍了Android 11 Scoped 存储权限的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在努力更好地了解 Android 11 版本发布后我将能够做什么.

I'm trying to better understand what I will be able to do once the Android 11 version will be released.

我的应用程序使用 Environment.getExternalStorageDirectory() 提供的图像文件路径来创建照片相册,但使用 Android 11 我将无法直接访问文件强>.

My App use the file paths of images provided by Environment.getExternalStorageDirectory() to create albums of photos, but with Android 11 I won't be able to access directly files.

根据 Android 开发者文档,他们最近引入了 MANAGE_EXTERNAL_STORAGE 权限,但我不明白是否添加此权限我可以通过 Environment 或不.

According to the Android developers documentation they recently introduced the MANAGE_EXTERNAL_STORAGE permission, but I didn't understand if adding this permission I'm able to continue to access file by Environment or not.

有没有人有想法???

谢谢

2021 年 1 月更新

我在 Android 11 虚拟设备上尝试了我的应用程序,即使没有请求 MANAGE_EXTERNAL_STORAGE 许可,它似乎也能完美运行!

I tried my application on an Android 11 Virtual device and it seems to work perfectly even without requesting the MANAGE_EXTERNAL_STORAGE permission!

阅读 Android Developers 上的文档,似乎使用 FILE API 访问照片和媒体仅位置的应用程序可以继续工作,但 我不确定强>.

Reading the documentation on Android Developers, it seems that the applications that uses the FILE API for accessing Photos and Medias only locations can continue to work, but I'am not sure.

有没有更懂Android文档的人???

Is there anyone who better understood the Android Documentation???

推荐答案

根据 Android 开发者文档,他们最近引入了 MANAGE_EXTERNAL_STORAGE 权限,但我不明白添加此权限是否可以继续通过环境访问文件.

According to the Android developers documentation they recently introduced the MANAGE_EXTERNAL_STORAGE permission, but I didn't understand if adding this permission I'm able to continue to access file by Environment or not.

是的,你会的.但是,请记住,如果您打算在 Play 商店(也可能是其他地方)上分发您的应用程序,您需要证明请求该许可的理由.因此,除非您有非常充分的理由使用MANAGE_EXTERNAL_STORAGE,否则请使用别的东西.

Yes, you will. However, bear in mind that if you intend to distribute your app on the Play Store (and perhaps elsewhere), you will need to justify the reason for requesting that permission. So, unless you have a very good reason to use MANAGE_EXTERNAL_STORAGE, please use something else.

这篇关于Android 11 Scoped 存储权限的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆