Example usage for Java android.net ConnectivityManager fields, constructors, methods, implement or subclass
The text is from its open source code.
String | CONNECTIVITY_ACTION A change in network connectivity has occurred. |
String | EXTRA_NETWORK_INFO The lookup key for a NetworkInfo object. |
String | EXTRA_NETWORK_TYPE Network type which triggered a #CONNECTIVITY_ACTION broadcast. |
String | EXTRA_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. |
String | EXTRA_OTHER_NETWORK_INFO The lookup key for a NetworkInfo object. |
String | EXTRA_NO_CONNECTIVITY The lookup key for a boolean that indicates whether there is a complete lack of connectivity, i.e., no network is available. |
String | EXTRA_REASON The lookup key for a string that indicates why an attempt to connect to a network failed. |
String | EXTRA_EXTRA_INFO The lookup key for a string that provides optionally supplied extra information about the network state. |
String | ACTION_BACKGROUND_DATA_SETTING_CHANGED Broadcast Action: The setting for background data usage has changed values. |
int | TYPE_MOBILE A Mobile data connection. |
int | TYPE_WIFI A WIFI data connection. |
int | TYPE_MOBILE_MMS An MMS-specific Mobile data connection. |
int | TYPE_MOBILE_SUPL A SUPL-specific Mobile data connection. |
int | TYPE_MOBILE_DUN A DUN-specific Mobile data connection. |
int | TYPE_MOBILE_HIPRI A High Priority Mobile data connection. |
int | TYPE_WIMAX A WiMAX data connection. |
int | TYPE_BLUETOOTH A Bluetooth data connection. |
int | TYPE_DUMMY Dummy data connection. |
int | TYPE_ETHERNET An Ethernet data connection. |
int | TYPE_VPN A virtual network using one or more native bearers. |
int | RESTRICT_BACKGROUND_STATUS_ENABLED Device is restricting metered network activity while application is running on background. |
String | ACTION_RESTRICT_BACKGROUND_CHANGED A change in the background metered network activity restriction has occurred. |
boolean | bindProcessToNetwork(@Nullable Network network) Binds the current process to network . |
Network | getActiveNetwork() Returns a Network object corresponding to the currently active default data network. |
NetworkInfo | getActiveNetworkInfo() 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. |
boolean | getBackgroundDataSetting() Returns the value of the setting for background data usage. |
Class> | getClass() Returns the runtime class of this Object . |
LinkProperties | getLinkProperties(int networkType) Returns the IP information for a given network type. |
LinkProperties | getLinkProperties(@Nullable Network network) Get the LinkProperties for the given Network . |
NetworkInfo | getNetworkInfo(int networkType) Returns connection status information about a particular network type. |
NetworkInfo | getNetworkInfo(@Nullable Network network) Returns connection status information about a particular Network. |
int | getNetworkPreference() Retrieves the current preferred network type. |
int | getRestrictBackgroundStatus() Determines if the calling application is subject to metered network restrictions while running on background. |
boolean | isActiveNetworkMetered() Returns if the currently active data network is metered. |
boolean | isNetworkSupported(int networkType) Returns true if the hardware supports the given network type else it returns false. |
boolean | isNetworkTypeMobile(int networkType) Checks if a given type uses the cellular data connection. |
boolean | isNetworkTypeValid(int networkType) Tests if a given integer represents a valid network type. |
void | registerNetworkCallback(@NonNull NetworkRequest request, @NonNull NetworkCallback networkCallback) Registers to receive notifications about all networks which satisfy the given NetworkRequest . |
void | registerNetworkCallback(@NonNull NetworkRequest request, @NonNull PendingIntent operation) Registers a PendingIntent to be sent when a network is available which satisfies the given NetworkRequest . |
void | requestNetwork(@NonNull NetworkRequest request, @NonNull NetworkCallback networkCallback) Request a network to satisfy a set of android.net.NetworkCapabilities . |
void | requestNetwork(@NonNull NetworkRequest request, @NonNull PendingIntent operation) Request a network to satisfy a set of android.net.NetworkCapabilities . |
boolean | requestRouteToHost(int networkType, int hostAddress) Ensure that a network route exists to deliver traffic to the specified host via the specified network interface. |
void | setNetworkPreference(int preference) Specifies the preferred network type. |
boolean | setProcessDefaultNetwork(@Nullable Network network) Binds the current process to network . |
int | startUsingNetworkFeature(int networkType, String feature) Tells the underlying networking system that the caller wants to begin using the named feature. |
String | toString() Returns a string representation of the object. |
void | unregisterNetworkCallback(@NonNull NetworkCallback networkCallback) Unregisters a NetworkCallback and possibly releases networks originating from #requestNetwork(NetworkRequest,NetworkCallback) and #registerNetworkCallback(NetworkRequest,NetworkCallback) calls. |
void | unregisterNetworkCallback(@NonNull PendingIntent operation) Unregisters a callback previously registered via #registerNetworkCallback(NetworkRequest,android.app.PendingIntent) . |