Java android.net ConnectivityManager fields, constructors, methods, implement or subclass

Example usage for Java android.net ConnectivityManager fields, constructors, methods, implement or subclass

Introduction

In this page you can find the methods, fields and constructors for android.net ConnectivityManager.

The text is from its open source code.

Field

StringCONNECTIVITY_ACTION
A change in network connectivity has occurred.
StringEXTRA_NETWORK_INFO
The lookup key for a NetworkInfo object.
StringEXTRA_NETWORK_TYPE
Network type which triggered a #CONNECTIVITY_ACTION broadcast.
StringEXTRA_IS_FAILOVER
The lookup key for a boolean that indicates whether a connect event is for a network to which the connectivity manager was failing over following a disconnect on another network.
StringEXTRA_OTHER_NETWORK_INFO
The lookup key for a NetworkInfo object.
StringEXTRA_NO_CONNECTIVITY
The lookup key for a boolean that indicates whether there is a complete lack of connectivity, i.e., no network is available.
StringEXTRA_REASON
The lookup key for a string that indicates why an attempt to connect to a network failed.
StringEXTRA_EXTRA_INFO
The lookup key for a string that provides optionally supplied extra information about the network state.
StringACTION_BACKGROUND_DATA_SETTING_CHANGED
Broadcast Action: The setting for background data usage has changed values.
intTYPE_MOBILE
A Mobile data connection.
intTYPE_WIFI
A WIFI data connection.
intTYPE_MOBILE_MMS
An MMS-specific Mobile data connection.
intTYPE_MOBILE_SUPL
A SUPL-specific Mobile data connection.
intTYPE_MOBILE_DUN
A DUN-specific Mobile data connection.
intTYPE_MOBILE_HIPRI
A High Priority Mobile data connection.
intTYPE_WIMAX
A WiMAX data connection.
intTYPE_BLUETOOTH
A Bluetooth data connection.
intTYPE_DUMMY
Dummy data connection.
intTYPE_ETHERNET
An Ethernet data connection.
intTYPE_VPN
A virtual network using one or more native bearers.
intRESTRICT_BACKGROUND_STATUS_ENABLED
Device is restricting metered network activity while application is running on background.
StringACTION_RESTRICT_BACKGROUND_CHANGED
A change in the background metered network activity restriction has occurred.

Method

booleanbindProcessToNetwork(@Nullable Network network)
Binds the current process to network .
NetworkgetActiveNetwork()
Returns a Network object corresponding to the currently active default data network.
NetworkInfogetActiveNetworkInfo()
Returns details about the currently active default data network.
NetworkInfo[]getAllNetworkInfo()
Returns connection status information about all network types supported by the device.
Network[]getAllNetworks()
Returns an array of all Network currently tracked by the framework.
booleangetBackgroundDataSetting()
Returns the value of the setting for background data usage.
ClassgetClass()
Returns the runtime class of this Object .
LinkPropertiesgetLinkProperties(int networkType)
Returns the IP information for a given network type.
LinkPropertiesgetLinkProperties(@Nullable Network network)
Get the LinkProperties for the given Network .
NetworkInfogetNetworkInfo(int networkType)
Returns connection status information about a particular network type.
NetworkInfogetNetworkInfo(@Nullable Network network)
Returns connection status information about a particular Network.
intgetNetworkPreference()
Retrieves the current preferred network type.
intgetRestrictBackgroundStatus()
Determines if the calling application is subject to metered network restrictions while running on background.
booleanisActiveNetworkMetered()
Returns if the currently active data network is metered.
booleanisNetworkSupported(int networkType)
Returns true if the hardware supports the given network type else it returns false.
booleanisNetworkTypeMobile(int networkType)
Checks if a given type uses the cellular data connection.
booleanisNetworkTypeValid(int networkType)
Tests if a given integer represents a valid network type.
voidregisterNetworkCallback(@NonNull NetworkRequest request, @NonNull NetworkCallback networkCallback)
Registers to receive notifications about all networks which satisfy the given NetworkRequest .
voidregisterNetworkCallback(@NonNull NetworkRequest request, @NonNull PendingIntent operation)
Registers a PendingIntent to be sent when a network is available which satisfies the given NetworkRequest .
voidrequestNetwork(@NonNull NetworkRequest request, @NonNull NetworkCallback networkCallback)
Request a network to satisfy a set of android.net.NetworkCapabilities .
voidrequestNetwork(@NonNull NetworkRequest request, @NonNull PendingIntent operation)
Request a network to satisfy a set of android.net.NetworkCapabilities .
booleanrequestRouteToHost(int networkType, int hostAddress)
Ensure that a network route exists to deliver traffic to the specified host via the specified network interface.
voidsetNetworkPreference(int preference)
Specifies the preferred network type.
booleansetProcessDefaultNetwork(@Nullable Network network)
Binds the current process to network .
intstartUsingNetworkFeature(int networkType, String feature)
Tells the underlying networking system that the caller wants to begin using the named feature.
StringtoString()
Returns a string representation of the object.
voidunregisterNetworkCallback(@NonNull NetworkCallback networkCallback)
Unregisters a NetworkCallback and possibly releases networks originating from #requestNetwork(NetworkRequest,NetworkCallback) and #registerNetworkCallback(NetworkRequest,NetworkCallback) calls.
voidunregisterNetworkCallback(@NonNull PendingIntent operation)
Unregisters a callback previously registered via #registerNetworkCallback(NetworkRequest,android.app.PendingIntent) .