public class ReactiveNetwork
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
LOG_TAG |
Modifier | Constructor and Description |
---|---|
protected |
ReactiveNetwork() |
Modifier and Type | Method and Description |
---|---|
static ReactiveNetwork |
create()
Creates a new instance of the ReactiveNetwork class
|
static <any> |
observeInternetConnectivity()
Observes connectivity with the Internet with default settings.
|
static <any> |
observeInternetConnectivity(InternetObservingStrategy strategy)
Observes connectivity with the Internet with default settings,
but with custom InternetObservingStrategy.
|
static <any> |
observeInternetConnectivity(InternetObservingStrategy strategy,
int initialIntervalInMs,
int intervalInMs,
java.lang.String host,
int port,
int timeoutInMs,
ErrorHandler errorHandler)
Observes connectivity with the Internet
|
static <any> |
observeInternetConnectivity(InternetObservingStrategy strategy,
java.lang.String host)
Observes connectivity with the Internet with default settings,
but with custom InternetObservingStrategy and host.
|
static <any> |
observeInternetConnectivity(int initialIntervalInMs,
int intervalInMs,
java.lang.String host,
int port,
int timeoutInMs)
Observes connectivity with the Internet in a given time interval.
|
static <any> |
observeInternetConnectivity(int initialIntervalInMs,
int intervalInMs,
java.lang.String host,
int port,
int timeoutInMs,
ErrorHandler errorHandler)
Observes connectivity with the Internet by opening connection with remote host in a given time
interval.
|
static <any> |
observeInternetConnectivity(int intervalInMs,
java.lang.String host,
int port,
int timeoutInMs)
Observes connectivity with the Internet in a given time interval.
|
static <any> |
observeNetworkConnectivity(android.content.Context context)
Observes network connectivity.
|
static <any> |
observeNetworkConnectivity(android.content.Context context,
NetworkObservingStrategy strategy)
Observes network connectivity.
|
public static final java.lang.String LOG_TAG
public static ReactiveNetwork create()
public static <any> observeNetworkConnectivity(android.content.Context context)
context
- Context of the activity or an applicationpublic static <any> observeNetworkConnectivity(android.content.Context context, NetworkObservingStrategy strategy)
context
- Context of the activity or an applicationstrategy
- NetworkObserving strategy to be applied - you can use one of the existing
strategies PreLollipopNetworkObservingStrategy
,
LollipopNetworkObservingStrategy
or create your own custom strategypublic static <any> observeInternetConnectivity()
observeNetworkConnectivity(Context)
method and consumes data
transfer, but it gives you actual information if device is connected to the Internet or not.public static <any> observeInternetConnectivity(InternetObservingStrategy strategy)
observeNetworkConnectivity(Context)
method and consumes data
transfer, but it gives you actual information if device is connected to the Internet or not.strategy
- which implements InternetObservingStrategypublic static <any> observeInternetConnectivity(InternetObservingStrategy strategy, java.lang.String host)
observeNetworkConnectivity(Context)
method and consumes data
transfer, but it gives you actual information if device is connected to the Internet or not.strategy
- which implements InternetObservingStrategyhost
- for checking Internet connectivitypublic static <any> observeInternetConnectivity(int intervalInMs, java.lang.String host, int port, int timeoutInMs)
intervalInMs
- in milliseconds determining how often we want to check connectivityhost
- for checking Internet connectivityport
- for checking Internet connectivitytimeoutInMs
- for pinging remote host in millisecondspublic static <any> observeInternetConnectivity(int initialIntervalInMs, int intervalInMs, java.lang.String host, int port, int timeoutInMs)
initialIntervalInMs
- in milliseconds determining the delay of the first connectivity
checkintervalInMs
- in milliseconds determining how often we want to check connectivityhost
- for checking Internet connectivityport
- for checking Internet connectivitytimeoutInMs
- for pinging remote host in millisecondspublic static <any> observeInternetConnectivity(int initialIntervalInMs, int intervalInMs, java.lang.String host, int port, int timeoutInMs, ErrorHandler errorHandler)
initialIntervalInMs
- in milliseconds determining the delay of the first connectivity
checkintervalInMs
- in milliseconds determining how often we want to check connectivityhost
- for checking Internet connectivityport
- for checking Internet connectivitytimeoutInMs
- for pinging remote host in millisecondserrorHandler
- for handling errors during connectivity checkpublic static <any> observeInternetConnectivity(InternetObservingStrategy strategy, int initialIntervalInMs, int intervalInMs, java.lang.String host, int port, int timeoutInMs, ErrorHandler errorHandler)
strategy
- for observing Internet connectivityinitialIntervalInMs
- in milliseconds determining the delay of the first connectivity
checkintervalInMs
- in milliseconds determining how often we want to check connectivityhost
- for checking Internet connectivityport
- for checking Internet connectivitytimeoutInMs
- for pinging remote host in millisecondserrorHandler
- for handling errors during connectivity check