是否有可能有"可选"在Android权限?有可能、可选、权限、QUOT

2023-09-05 01:53:37 作者:遙遙無遠方

有没有办法为一个Android应用程序申报要求的权限为可选?

Is there any way for an Android application to declare requested permissions as optional?

即。我想写一个应用程序,要求一组权限,如其中之一是获得了用户联系人。现在,应用程序可以工作,做有用的事情没有这个访问权限,但它可以做得更多,如果它是理所当然的。

I.e. I want to write an app that requests a set of permissions, e.g. one of them being access to the user contacts. Now the application can work and do useful things without this access permission, but it can do more if it is granted.

有没有一种方式和应用程序的说:我希望许可X,但你可以拒绝它在这种情况下,我很高兴与功能减少跑?

Is there a way for and app to say "I want permission X, but you can refuse it in which case I'm happy to run with reduced functionality?"

推荐答案

我不这么认为,因为权限设置在清单中,并通过在安装apk文件的用户所接受。你可以建立一个简易版本与减少的权限和有限的功能集的应用程序,它提供了作为替代。

I don't believe so, since permissions are set in the manifest and accepted by the user upon installing the .apk. You could build a light version of the application with reduced permissions and limited feature set and offer it as an alternative.