我可以跳过对棉花糖的运行时权限询问吗? [英] Can i skip asking Runtime Permissions on marshmallow?

本文介绍了我可以跳过对棉花糖的运行时权限询问吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

现在这对我来说非常有趣,我对运行时权限非常了解,并且我很清楚为什么建议运行时权限?我们如何使用它?但是在

解决方案


这样做有什么实际的弊端吗?


如果用户不喜欢授予所有权限,他们可以选择不安装您的应用程序在前面。此外,基于较高的 targetSdkVersion 值可能想要的其他行为也可能会丢失。


安全性将发生什么,这是RunTimePermissions的主要目的


什么都没有。您仍然需要所有< uses-permission> 元素,并且用户仍然必须同意为您提供权限。但是,该协议主要发生在安装时,而不是在运行应用程序时发生。请记住,Android 6.0+设备的用户仍然可以通过设置应用撤消危险级权限。


这样做真的更可取吗?


恕我直言,不。最终,有些事情会迫使您动手,并要求您升级 targetSdkVersion 。而且,正如我已经指出的那样,用户可能更喜欢不安装您的应用程序,而与其他一些应用程序一起使用,该应用程序在安装时不需要很多权限。对于不再维护的应用程序或经验不足的开发人员,使用低于23的 targetSdkVersion 是一个很好的答案。


Now this is something very interesting for me, I know mostly about Runtime Permissions and i am well aware of why Runtime Permissions proposed? and How we can use it? but in this question which is about a problem rising due to this run time permission thing, A guy proposed a pretty newer way to solve this problem.

See U.swap's answer on the same question,here is that answer.

This guy Proposed a nice and working solution that user have to approve Permissions only once and for rest of his life he don't have to worry about all Runtime permissions and application will run on marshmallow versions and Pre-marshmallow versions as discussed in comments see all comments as discussed between me and Commonsware.

@NiteshPareek: There is nothing about this answer that prevents the app from running on Android 6.0+ devices -Commonsware

but it means that we can buypass the security proposed by Runtime Permissions? @CommonsWare – Tapan parmar

@Tapanparmar: No, as users can manually revoke permissions in Settings. Having targetSdkVersion 22 or lower means that your app is not going to have any runtime permission code, so the user needs to agree to your requested permissions at install time. This is how Android worked from the beginning. – CommonsWare

ok so app will run on marshmallow without showing permissions? @CommonsWare - Tapan Parmar

@Tapanparmar: The user will be presented with permissions at the time the app is installed. – CommonsWare

ok so we can skip that freaking permissions providing by this but is there any drawbacks by doing it? @CommonsWare

@Tapanparmar: Users may elect not to install your app, if they do not like granting all the permissions up front. Also, other behaviors that you might want based on higher targetSdkVersion values may be lost. If you have additional concerns, please ask a separate Stack Overflow question. – CommonsWare

So i want to know are there any actual drawbacks of doing this? And what will happen to security which was main purpose of RunTimePermissions. And is it really preferable to do this?

See the comments here on the answer or see the image below

解决方案

are there any actual drawbacks of doing this?

Users may elect not to install your app, if they do not like granting all the permissions up front. Also, other behaviors that you might want based on higher targetSdkVersion values may be lost.

And what will happen to security which was main purpose of RunTimePermissions

Nothing. You still need all the <uses-permission> elements, and the user still has to agree to give you the permissions. However, that agreement occurs primarily at install time, not when the app is run. Bear in mind that users of Android 6.0+ devices still can revoke the dangerous-level permissions via the Settings app.

And is it really preferable to do this?

IMHO, no. Eventually, something is going to force your hand and require you to upgrade your targetSdkVersion. And, as I have noted, users may prefer to not install your app, going with some other app, one that does not ask for a lot of permissions at install time. Using a targetSdkVersion below 23 is a fine answer for apps that are no longer being maintained or for inexperienced developers.

这篇关于我可以跳过对棉花糖的运行时权限询问吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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