public final class ConnectionUtils extends Object
| Modifier and Type | Method and Description |
|---|---|
static boolean |
isConnectionAvailable(android.content.Context context,
int connectionType)
Checks whether there is connection of the requested connectionType available or not.
|
static boolean |
isConnectionEstablished(android.content.Context context)
Checks whether there is some connection currently established or not.
|
static boolean |
isConnectionEstablished(android.content.Context context,
int connectionType)
Checks whether there is connection of the requested connectionType currently established
or not.
|
static android.net.NetworkInfo |
obtainEstablishedConnectionInfo(android.content.Context context)
Obtains info of the currently established connection.
|
static int |
obtainEstablishedConnectionType(android.content.Context context)
Obtains type of the currently established connection.
|
public static boolean isConnectionEstablished(android.content.Context context)
See ConnectivityManager.getActiveNetworkInfo() for additional info.
context - Context used to access ConnectivityManager.True if there is some connection available and it is currently established,
false otherwise.isConnectionEstablished(Context, int)public static boolean isConnectionEstablished(android.content.Context context,
int connectionType)
See NetworkInfo.isConnected() for additional info.
context - Context used to access ConnectivityManager.connectionType - Type of the desired connection of which current connectivity to check.True if there is connection of the requested type available and it is
currently established, false otherwise.isConnectionEstablished(Context),
isConnectionAvailable(Context, int)public static boolean isConnectionAvailable(android.content.Context context,
int connectionType)
See NetworkInfo.isAvailable() for additional info.
context - Context used to access ConnectivityManager.connectionType - Type of the desired connection of which availability to check.True if connection of the requested type available, false
otherwise.isConnectionEstablished(Context, int)public static int obtainEstablishedConnectionType(android.content.Context context)
See ConnectivityManager.getActiveNetworkInfo() for additional info.
context - Context used to access ConnectivityManager.ConnectivityManager or -1 if
there is no connection currently established.obtainEstablishedConnectionInfo(Context),
isConnectionEstablished(Context)public static android.net.NetworkInfo obtainEstablishedConnectionInfo(android.content.Context context)
context - Context used to access ConnectivityManager.ConnectivityManager or null if there
is on connection currently established.obtainEstablishedConnectionType(Context),
isConnectionEstablished(Context)