DataProvider

Generic data provider for various types of tracking data.

Usage:

Parameters

T

The type of tracking data.

Inheritors

Types

Link copied to clipboard
fun interface DataListener<T>

The listener for receiving data from a DataProvider.

Link copied to clipboard

The result of start, represent the state when start is called.

Link copied to clipboard

Represents the state of the current DataProvider.

Link copied to clipboard

Indicates whether the current type of data is supported now.

Properties

Link copied to clipboard
abstract val dataFlow: SharedFlow<T>

The SharedFlow of tracking data. This flow is a hot flow with no replay.

Link copied to clipboard
abstract val latestData: T

The latest tracking data.

Link copied to clipboard

The state of the current DataProvider.

Link copied to clipboard

The support state of the data type.

Functions

Link copied to clipboard
abstract fun addListener(listener: DataProvider.DataListener<T>)

Adds a DataListener to receive data.

Link copied to clipboard
abstract fun removeListener(listener: DataProvider.DataListener<T>)

Removes a DataListener to stop receiving data.

Link copied to clipboard

Starts providing tracking data.

Link copied to clipboard
abstract fun stop()

Stops providing tracking data.