Please note that the contents of this offline web site may be out of date. To access the most recent documentation visit the online version .
Note that links that point to online resources are green in color and will open in a new window.
We would love it if you could give us feedback about this material by filling this form (You have to be online to fill it)
Android APIs
public class

ConnectivityManagerCompat

extends Object
java.lang.Object
   ↳ android.support.v4.net.ConnectivityManagerCompat

Class Overview

Helper for accessing features in ConnectivityManager introduced after API level 16 in a backwards compatible fashion.

Summary

Public Constructors
ConnectivityManagerCompat ()
Public Methods
static NetworkInfo getNetworkInfoFromBroadcast ( ConnectivityManager cm, Intent intent)
Return the NetworkInfo that caused the given CONNECTIVITY_ACTION broadcast.
static boolean isActiveNetworkMetered ( ConnectivityManager cm)
Returns if the currently active data network is metered.
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public ConnectivityManagerCompat ()

Public Methods

public static NetworkInfo getNetworkInfoFromBroadcast ( ConnectivityManager cm, Intent intent)

Return the NetworkInfo that caused the given CONNECTIVITY_ACTION broadcast. This obtains the current state from ConnectivityManager instead of using the potentially-stale value from EXTRA_NETWORK_INFO . May be null .

public static boolean isActiveNetworkMetered ( ConnectivityManager cm)

Returns if the currently active data network is metered. A network is classified as metered when the user is sensitive to heavy data usage on that connection. You should check this before doing large data transfers, and warn the user or delay the operation until another network is available.