ConnectivityState

class ConnectivityState(connectivity: Connectivity, scope: CoroutineScope)

Represents the state of network connectivity.

This class provides properties and functions for monitoring the network status and checking whether the device is connected to the network or a metered network.

Constructors

Link copied to clipboard
constructor(connectivity: Connectivity, scope: CoroutineScope)

Properties

Link copied to clipboard

A Boolean indicating whether the device is connected to the network.

Link copied to clipboard

A Boolean indicating whether the device is disconnected from the network.

Link copied to clipboard

A Boolean indicating whether the device is connected to a metered network.

Link copied to clipboard
Link copied to clipboard

The current network status.

Functions

Link copied to clipboard

Force a check of the current network status.

Link copied to clipboard

Start monitoring the network status.

Link copied to clipboard

Stop monitoring the network status.