AndroidNetworkConnectivity

Implementation of NetworkConnectivity for Android.

In the Android system, ConnectivityManager is used to monitor network connectivity states.

Note: This implementation requires the ACCESS_NETWORK_STATE permission.

<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />

Constructors

Link copied to clipboard
constructor(context: Context)

Types

Link copied to clipboard

Functions

Link copied to clipboard
@RequiresPermission(value = "android.permission.ACCESS_NETWORK_STATE")
open override fun addObserver(observer: NetworkConnectivity.Observer)

Adds an observer to receive events.

Link copied to clipboard

Provides a Flow to receive events of network connectivity.

Link copied to clipboard
open override fun removeObserver(observer: NetworkConnectivity.Observer)

Removes an observer that receives events.