public class PhoneUtils
extends java.lang.Object
PhoneUtils.isRotationEnabled
(this);
PhoneUtils.isNetworkAvailable
(this);
PhoneUtils.isConnectedWifi
(this);
PhoneUtils.isConnectedMobile
(this);
Constructor and Description |
---|
PhoneUtils() |
Modifier and Type | Method and Description |
---|---|
static boolean |
isConnectedMobile(android.content.Context context)
Check if there is any connectivity to a mobile network
Can be used in combination with
isConnectedWifi(android.content.Context)
to provide different features if the device is on a wifi network or a cell network. |
static boolean |
isConnectedWifi(android.content.Context context)
Check if there is any connectivity to a Wifi network.
|
static boolean |
isNetworkAvailable(android.content.Context context)
Checks to see if the device is connected to a network (cell, wifi, etc).
|
static boolean |
isRotationEnabled(android.content.Context context)
Checks to see if the user has rotation enabled/disabled in their phone settings.
|
public static boolean isRotationEnabled(android.content.Context context)
context
- The current Context or Activity that this method is called frompublic static boolean isNetworkAvailable(android.content.Context context)
context
- The current Context or Activity that this method is called frompublic static boolean isConnectedWifi(android.content.Context context)
isConnectedMobile(android.content.Context)
to provide different features if the device is on a wifi network or a cell network.context
- The current Context or Activity that this method is called frompublic static boolean isConnectedMobile(android.content.Context context)
isConnectedWifi(android.content.Context)
to provide different features if the device is on a wifi network or a cell network.context
- The current Context or Activity that this method is called from