在运行时是否需要Internet许可请求(Android)? [英] Is the request for internet persmission required at runtime (Android)?

查看:85
本文介绍了在运行时是否需要Internet许可请求(Android)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

对于Android,要求我们在运行时询问权限,以确保用户更好地理解了何时需要权限.我知道这对于WRITE_CALENDARACCESS_FINE_LOCATION之类的权限是正确的,但似乎对于INTERNET并不是必需的.并不奇怪,因为几乎所有应用程序都使用互联网.

For Android, it is required that we ask permissions at runtime to make sure users understand better why en when permissions are needed. I know this is true for permissions like WRITE_CALENDAR and ACCESS_FINE_LOCATION but it seems it's not required for INTERNET. Not strange because almost all apps use internet.

可以肯定地说我只需要在清单中声明它吗?

Is it safe to say that I only need to declare it in the manifest?

<uses-permission android:name="android.permission.INTERNET" />

还是我应该始终在运行时检查它?

Or should I always check it at runtime?

推荐答案

不,您不应该在运行时请求INTERNET权限.

No, you shouldn't ask for INTERNET permission at runtime.

INTERNET属于普通权限组,该组自动由系统,如果它们在清单中声明,如本文档中所述:

INTERNET belongs to the Normal permissions group, which are automatically granted by the system if they're declared in the Manifest, as mentioned in this document:

普通权限不会直接危害用户的隐私.如果您的应用在清单中列出了正常权限,则系统会自动授予该权限.

Normal permissions do not directly risk the user's privacy. If your app lists a normal permission in its manifest, the system grants the permission automatically.

这篇关于在运行时是否需要Internet许可请求(Android)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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