public class POBNetworkMonitor
extends java.lang.Object
POBInstanceProvider.getNetworkMonitor(android.content.Context)
method instead of creating new instance.| Modifier and Type | Class and Description |
|---|---|
static class |
POBNetworkMonitor.ConnectionType
Enum constant to maintain connection Type
Required for OpenWrap RTB 2.5
|
static interface |
POBNetworkMonitor.POBConnectivityListener
Interface definition to provide connectivity callbacks
|
| Modifier and Type | Field and Description |
|---|---|
protected java.util.List<POBNetworkMonitor.POBConnectivityListener> |
connectivityListeners |
| Constructor and Description |
|---|
POBNetworkMonitor(android.content.Context context)
Construct POBNetworkMonitor
Please use
POBInstanceProvider.getNetworkMonitor(android.content.Context)
method instead of creating new instance. |
| Modifier and Type | Method and Description |
|---|---|
POBNetworkMonitor.ConnectionType |
getConnectionType() |
boolean |
isNetworkAvailable()
Method is used to check if network is available
|
static boolean |
isNetworkAvailable(android.content.Context appContext)
Method is used to check if network is available
|
boolean |
isWiFiConnected() |
void |
registerConnectivityListener(POBNetworkMonitor.POBConnectivityListener connectivityListener)
Method is used to register the POBConnectivityListener to connectivityListeners`
|
void |
resetConnectivityListener()
Method is used to reset connectivity listener
|
void |
unregisterConnectivityListener(POBNetworkMonitor.POBConnectivityListener connectivityListener)
Method is used to unregister specific POBConnectivityListener which already registered
|
void |
updateConnectionType()
Updates connection type using connectivity manager, This method has to be called from constructor
and from broadcast receivers onReceive() method for action connectivity change.
|
@Nullable protected java.util.List<POBNetworkMonitor.POBConnectivityListener> connectivityListeners
public POBNetworkMonitor(@NonNull
android.content.Context context)
POBInstanceProvider.getNetworkMonitor(android.content.Context)
method instead of creating new instance.context - application contextpublic boolean isWiFiConnected()
@NonNull public POBNetworkMonitor.ConnectionType getConnectionType()
public boolean isNetworkAvailable()
public static boolean isNetworkAvailable(android.content.Context appContext)
appContext - of android application contextpublic void updateConnectionType()
@MainThread public void resetConnectivityListener()
@MainThread
public void unregisterConnectivityListener(@Nullable
POBNetworkMonitor.POBConnectivityListener connectivityListener)
connectivityListener - of type POBConnectivityListener@MainThread public void registerConnectivityListener(POBNetworkMonitor.POBConnectivityListener connectivityListener)
connectivityListener - of type POBConnectivityListener