SupportConnectivity

class SupportConnectivity(connectivityManager: ConnectivityManager?, connectivityCapabilities: Int = NetworkCapabilities.NET_CAPABILITY_INTERNET) : ISupportConnectivity

Inspired by ConnectivityChecker

Lifecycle aware connectivity checker that exposes the network connected status via a StateFlow.

The loss of connectivity when the activity is resumed should be a blocker for the user in onResume, we should get the connectivity status.

Since

v1.2.0

Constructors

Link copied to clipboard
constructor(connectivityManager: ConnectivityManager?, connectivityCapabilities: Int = NetworkCapabilities.NET_CAPABILITY_INTERNET)

Properties

Link copied to clipboard
open override val connectivityStateFlow: Flow<ConnectivityState>

Connection state flow, allows us to monitor changes on the network connectivity

Link copied to clipboard
open override val isConnected: Boolean

Check if the device is connected to any network with internet capabilities, this is only a snapshot of the state at the time of request