android.permission.INTERNET? [英] android.permission.INTERNET?

查看:168
本文介绍了android.permission.INTERNET?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在我的应用中使用了三个按钮1)反馈按钮:它允许用户通过任何邮件应用程序发送反馈2)使用分享意图的分享按钮3)一个评分应用"按钮,可在Play商店中打开我的应用页面

I'm using three buttons in my app 1) Feedback button: It allows the user to send feedback via any mail application 2) A share button which uses a share intent 3) A "rate app" button which opens my app's page on the play store

所有3个按钮都使用其他应用程序访问互联网.

All the 3 buttons uses other applications to access the internet.

我是否需要在清单文件中添加android.permission.INTERNET权限?

Do I need to add the android.permission.INTERNET permission in my manifest file?

推荐答案

在这种情况下,答案是不,正如Dipendra在其答案中指出的那样,在这种情况下不需要权限,因为应用程序正在发送它.通过外部应用程序将其作为Intent进行请求,而不是从其应用程序内部直接向网络发出请求.

The answer in this case is that no, the permissions are not required in this instance, as Dipendra has pointed out in his answer, as the application is sending it's requests as Intents via external applications and aren't direct requests to the network from within his application.

背景知识:

了解是否需要许可的最简单方法是在测试设备上使用您的应用程序.它能按您的预期工作吗?如果没有 INTERNET 权限,是否会收到任何错误消息?

The easiest way you can know whether you need the permission is to use your application on a test device. Does it work as you intended it? Do you get any errors without the INTERNET permission?

如果您这样做,那么很明显您需要它!如果不是这样(在此问题的情况下),则不需要 INTERNET 权限.

If you do, then its clear that you need it! If not (and in the case of this question's scenario), you do not need the INTERNET permission.

权限是一种安全功能.

有问题的许可是:

公共静态最终字符串INTERNET

public static final String INTERNET

允许应用程序打开网络套接字.

Allows applications to open network sockets.

常量值:"android.permission.INTERNET"

Constant Value: "android.permission.INTERNET"

如果您的应用程序需要网络套接字,则您的应用程序需要使用它们的权限.就这么简单.

If your application needs network sockets, then your application needs permission to use them. Simple as that.

如果需要获得许可,请将以下行添加到清单中:

Add the below line to your manifest if you require the permission:

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

那里有保护用户的权限,因此,它是有关提前了解您的应用程序意图的内容.

The permissions are there to protect the user, so it is about being upfront and clear of what your applications intentions are.

这篇关于android.permission.INTERNET?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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