Connectivity

fun Connectivity(provider: ConnectivityProvider, options: ConnectivityOptions = ConnectivityOptions(), scope: CoroutineScope = CoroutineScope(Dispatchers.Default)): Connectivity

Creates a Connectivity instance.

Return

A Connectivity instance.

Parameters

provider

The ConnectivityProvider to use for monitoring connectivity.

options

The ConnectivityOptions to use for configuring the connectivity monitoring.

scope

The CoroutineScope in which to launch the connectivity monitoring coroutine.


fun Connectivity(provider: ConnectivityProvider, scope: CoroutineScope = CoroutineScope(Dispatchers.Default), options: ConnectivityOptions.Builder.() -> Unit): Connectivity

Creates a Connectivity instance with a builder for the ConnectivityOptions.

Return

A Connectivity instance.

Parameters

provider

The ConnectivityProvider to use for monitoring connectivity.

scope

The CoroutineScope in which to launch the connectivity monitoring coroutine.

options

A builder function for creating the ConnectivityOptions.