How to grant runtime permissions to an android application without prompting the user

社会主义新天地 提交于 2019-12-17 21:34:24

问题


I am trying to build an android application which when installed through Google Playstore should have access to the runtime permissions like SMS Access, Contacts, Location Service without asking the user for it.

I know it is possible since I have seen it happen in a couple of Android Applications on Playstore like Kotak 811 App Standard Chartered Banking App

Does anyone know how this can be achieved even when the phone is running Android Nougat.


回答1:


How to grant runtime permissions to an android application without prompting the user

AFAIK it is not possible

Please read Run Time Permissions

I am trying to build an android application which when installed through Google Playstore should have access to the runtime permissions like SMS Access, Contacts, Location Service without asking the user for it.

than you have to make targetSdkVersion lower than 23

Does anyone know how this can be achieved even when the phone is running Android Nougat.

That is not possible and if user manually revoke the dangerous permission you app will crash

What are the disadvantages of doing targetSdkVersion lower than 23

if user manually remove permission from your app than you app get crash in android api 23 and above

EDIT you will not be able to ship updates to your app on the Play Store starting later in 2018

Meet Google Play's target API level requirement



来源:https://stackoverflow.com/questions/48108381/how-to-grant-runtime-permissions-to-an-android-application-without-prompting-the

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!