什么是ACCESS_NETWORK_STATE和互联网之间的区别是什么? [英] What's the difference between ACCESS_NETWORK_STATE and INTERNET?
问题描述
什么是ACCESS_NETWORK_STATE和互联网之间的区别是什么?
What's the difference between ACCESS_NETWORK_STATE and INTERNET?
如果我使用的互联网,是否有必要使用ACCESS_NETWORK_STATE?
If I use INTERNET, is it necessary to use ACCESS_NETWORK_STATE?
在换句话说,我可以用互联网,而无需使用ACCESS_NETWORK_STATE?
In other words, can I use INTERNET without using ACCESS_NETWORK_STATE?
推荐答案
从的文档
ACCESS_NETWORK_STATE
:
允许应用程序访问有关GSM网络信息
Allows applications to access information about networks
网络
:
允许应用程序打开网络套接字。
Allows applications to open network sockets.
总之,网络
许可,您可以使用互联网,而 ACCESS_NETWORK_STATE
只会给你有关的信息网络,如是否已连接到网络的。
In short, the INTERNET
permission lets you use the internet, whereas ACCESS_NETWORK_STATE
will just give you information about the network, such as whether you are connected to a network at all.
您可以使用任何一个,而无需其他。如果你想利用互联网之前不检查你有效的网络连接,你的HTTP请求只会失败。
You can use either one without needing the other. If you don't check that you a valid network connection before trying to use the internet, your HTTP requests will simply fail.
这篇关于什么是ACCESS_NETWORK_STATE和互联网之间的区别是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!