public class NetworkUtils extends Object
Constructor and Description |
---|
NetworkUtils() |
Modifier and Type | Method and Description |
---|---|
static int |
getNetworkType(Context context)
Returns the network connection type as defined in the ConnectivityManager class.
|
static String |
getNetworkTypeString(Context context)
Returns the network connection type as a human-readable String.
|
static boolean |
inFlightMode(Context context)
Returns true if the phone is in flight mode
|
static boolean |
isNetworkAvailable(Context context)
Tests the device's global connectivity.
|
static boolean |
isWiFiAvailable(Context context)
Tests the Wi-Fi connectivity.
|
public static boolean isNetworkAvailable(Context context)
context
- the contextpublic static boolean isWiFiAvailable(Context context)
context
- the contextpublic static String getNetworkTypeString(Context context)
context
- the contextpublic static int getNetworkType(Context context)
context
- the contextpublic static boolean inFlightMode(Context context)
context
- the app context