What s the difference between ACCESS_NETWORK_STATE and INTERNET
Whether you are a startup or a large enterprise, we look forward to building amazing solutions with you!
Required Permissions
Some functionality needs special permissions to work properly. Below you will find a list of some key permissions.
To add permissions, open AndroidManifest.xml . Add the following markup before the tags:
Note: If your app uses Android API level 23 ( Android 6.0) or above, you must also add code to request for permissions during runtime. You can find more information in the Request for Permissions section.
Permission ACCESS_FINE_LOCATION, Permission ACCESS_COARSE_LOCATION
These permissions are required to access precise location. In case this permission isn’t granted, PositioningManager.start(PositioningManager.LocationMethod) returns false and functionality like guidance navigation will not work.
Permission INTERNET
INTERNET permission is needed for the functionality that is based on Internet connection such as search, routing, online map rendering and others.
Permission ACCESS_NETWORK_STATE
ACCESS_NETWORK_STATE permission is needed to access information about network state. It allows to check if device is connected to internet or disconnected.
Permission CHANGE_NETWORK_STATE, Permission ACCESS_WIFI_STATE, Permission CHANGE_WIFI_STATE, Permission BLUETOOTH, Permission BLUETOOTH_ADMIN, Permission WAKE_LOCK, Permission READ_PHONE_STATE
These permissions are needed when HERE Positioning is used.
Permission WRITE_EXTERNAL_STORAGE
WRITE_EXTERNAL_STORAGE permission is needed when the map disk cache path is set outside of the app-specific directory.
Note: Starting in API level 19 android.permission.WRITE_EXTERNAL_STORAGE is no longer required if the map disk cache(See MapSettings.setDiskCacheRootPath(path) ) is set under an application-specific file directory.
Permission FOREGROUND_SERVICE
FOREGROUND_SERVICE permission is required for positioning when the app is in the background.
What’s the difference between ACCESS_NETWORK_STATE and INTERNET?
What’s the difference between ACCESS_NETWORK_STATE and INTERNET? If I use INTERNET, is it necessary to use ACCESS_NETWORK_STATE? In other words, can I use INTERNET without using ACCESS_NETWORK_STATE?
Alexandre Khoury
asked Oct 28, 2013 at 18:09
Alexandre Khoury Alexandre Khoury
3,896 5 5 gold badges 37 37 silver badges 58 58 bronze badges
Oct 28, 2013 at 18:11
3 Answers 3
Allows applications to access information about networks
Allows applications to open network sockets.
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.
You can use either one without needing the other. If you don’t check that you have a valid network connection before trying to use the Internet, your HTTP requests will simply fail.
Faster Better answers through AI
Whether you are a startup or a large enterprise, we look forward to building amazing solutions with you!
Uses-permission and Uses-feature
Read time: 2 mins
Uses-permission
Name | Permission Type | Feature |
---|---|---|
android.permission.INTERNET * | Normal | |
android.permission.ACCESS_NETWORK_STATE * | Normal | |
android.permission.CAMERA | Runtime | Voice and Video Photo and File Sharing |
android.permission.READ_EXTERNAL_STORAGE | Runtime | Voice and Video Audio Message Photo and File Sharing |
android.permission.WRITE_EXTERNAL_STORAGE | Runtime | Voice and Video Audio Message Photo and File Sharing |
android.permission.READ_MEDIA_IMAGES Android 13 and above | Runtime | Voice and Video Audio Message Photo and File Sharing |
android.permission.RECORD_AUDIO | Runtime | Voice and Video Audio Message |
android.webkit.resource.AUDIO_CAPTURE | Runtime | Voice and Video |
android.webkit.resource.VIDEO_CAPTURE | Runtime | Voice and Video |
android.permission.MODIFY_AUDIO_SETTINGS | Normal | Voice and Video |
android.permission.FOREGROUND_SERVICE | Normal | Photo and File Sharing |
android.permission.VIBRATE | Normal | Vibrate on new incoming message |
* Required permission
When a project has LivePerson Android SDK (lp_messaging_sdk) as one of dependencies, all of the other permissions will be merged into the final AndroidManifest.xml. Any of these permissions can be removed if the application does not use it.
Example: If an application does not implement Voice and Video yet, then it can remove corresponding permissions:
- Declare tools namespace in the element, to use merge rule maker, as shown here:
xmlns:android="http://schemas.android.com/apk/res/android" package="com.example.myapp" xmlns:tools="http://schemas.android.com/tools">
android:name="android.webkit.resource.AUDIO_CAPTURE" tools:node="remove"/> android:name="android.webkit.resource.VIDEO_CAPTURE" tools:node="remove"/> android:name="android.permission.MODIFY_AUDIO_SETTINGS" tools:node="remove"/>
Use merge rule makers carefully when the application has multiple dependencies.
Uses-feature
Name | Feature |
---|---|
android.hardware.audio.pro | Voice and Video |
android.hardware.microphone | Voice and Video |
Declare these features enables Google Play filter your application from devices that do not meet its hardware requirements. You can disable the filter by using merge rule makers. Check more in Voice and Video.