BluetoothAvailabilityHelper

class BluetoothAvailabilityHelper(coroutineScope: CoroutineScope, stateUpdateCallback: (bluetoothAvailable: Boolean) -> Unit)

Helper for getting the state of the bluetooth adapter availability.

The specified stateUpdateCallback is called with the current state of the Bluetooth adapter. The Bluetooth adapter is initially assumed to be turned off. This means that as long as it stays turned off stateUpdateCallback is not called. If the adapter is turned on at initialization, the stateUpdateCallback will be called with true.

Constructors

Link copied to clipboard
fun BluetoothAvailabilityHelper(coroutineScope: CoroutineScope, stateUpdateCallback: (bluetoothAvailable: Boolean) -> Unit)

Functions

Link copied to clipboard
fun onCreate(context: Context)
Link copied to clipboard
fun onDestroy()