Skip to content

Connection

Compare
Choose a tag to compare
@alkathirikhalid alkathirikhalid released this 19 Feb 07:51
· 37 commits to master since this release

Connection utility.

Monitor network connections like Wi-Fi, GPRS, UMTS, etc for API 16 and above, this class attempt to fail over to another network when connectivity to a network is lost by checking isConnectedOrConnecting, it provides a way that allows applications to query the coarse-grained or fine-grained state of the available networks by checking isTypeMobile or isTypeWifi. It also provides a way that allows applications to request and check networks for their fast data traffic by checking isConnectedConnectionFast or isConnectedConnectionSlow.

It is safer to check isConnectedConnectionSlow first or only rather than isConnectedConnectionFast first or combined, to allow forward compatibility in the event faster mobile connection are introduce in the future that are above 20 plus Mbps.

The class should be used as Connection.isConnectedConnectionSlow(context);.