LocationRecorder

class LocationRecorder(    val provider: FusedLocationProviderClient,     val folderPath: String,     val name: String,     val formatter: DataFormat<LocationResult>,     val request: LocationRequest,     val looperFactory: () -> Looper = { Looper.getMainLooper() }) : DataRecorder

Facilitates the recording of location data.

The class cannot be reused after it has been closed. Another instance must be created to restart recording.

Constructors

Link copied to clipboard
fun LocationRecorder(    provider: FusedLocationProviderClient,     folderPath: String,     name: String,     formatter: DataFormat<LocationResult>,     request: LocationRequest,     looperFactory: () -> Looper = { Looper.getMainLooper() })

Functions

Link copied to clipboard
open override fun close()

Stops the data recording and cleans up all the resources

Link copied to clipboard
open suspend override fun start()

Starts the data recording

Properties

Link copied to clipboard
val folderPath: String

Path to save the recordings

Link copied to clipboard
val formatter: DataFormat<LocationResult>

Formatting class use to format the data stream

Link copied to clipboard
val looperFactory: () -> Looper

Function that creates the looper for location updates

Link copied to clipboard
val name: String

Name of the file to save the recordings

Link copied to clipboard
val provider: FusedLocationProviderClient

A provider client from that registers callback for location updates

Link copied to clipboard
val request: LocationRequest

Request containing the details of the location stream to record