public class NetworkConnectionManager extends Object
Modifier and Type | Field and Description |
---|---|
private static Context |
context |
private static NetworkConnectionManager |
instance |
Modifier | Constructor and Description |
---|---|
protected |
NetworkConnectionManager(Context context) |
Modifier and Type | Method and Description |
---|---|
boolean |
checkWifiAccessPermissions()
Checks whether the application has provided permissions to access the wifi state.
|
static NetworkConnectionManager |
getInstance() |
static NetworkConnectionManager |
getInstance(Context context) |
String |
getMacAddress()
This method fetches a WLAN Mac Address, or null if the Mac Address is not available.
|
WifiInfo |
getWifiInfo()
Helper method, returns a WifiInfo instance or null if one cannot be accessed.
|
boolean |
isConnected()
Checks if the connection is currently available.
|
boolean |
isConnectedFast()
Check if there is fast connectivity
|
boolean |
isConnectedToCellular() |
private boolean |
isConnectionFast(int type,
int subType)
Check if the connection is fast
|
boolean |
isOnWiFi() |
static void |
release() |
private static Context context
private static NetworkConnectionManager instance
protected NetworkConnectionManager(Context context)
public static NetworkConnectionManager getInstance(Context context)
public static NetworkConnectionManager getInstance()
public boolean isOnWiFi()
public boolean isConnectedToCellular()
public boolean isConnectedFast()
private boolean isConnectionFast(int type, int subType)
type
- subType
- public boolean isConnected()
public boolean checkWifiAccessPermissions()
public String getMacAddress()
public WifiInfo getWifiInfo()
public static void release()