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

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

问题描述

我试图更好地了解Android 11版本发布后我将能够做些什么.

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

我的App使用 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权限,但我不知道是否添加此权限后我是否能够继续通过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.

是的,你会的.但是,请记住,如果您打算在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范围存储权限的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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