AndroidLocationProvider

class AndroidLocationProvider(context: Context, config: AndroidLocationProviderConfig = AndroidLocationProviderConfig()) : LocationProvider

Implementation of the LocationProvider which relies on the default Android mechanism to obtain location ( via LocationManager ).

Parameters

context

A context instance.

Constructors

Link copied to clipboard
constructor(context: Context, config: AndroidLocationProviderConfig = AndroidLocationProviderConfig())

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
open override val lastKnownLocation: GeoLocation?

The last known location, or null if no location has been determined yet.

Functions

Link copied to clipboard

Add a listener to the location provider. If and once enabled, the listener will start receiving location updates.

Link copied to clipboard
open override fun close()

Dispose the location provider, removes all listeners and disable the engine.

Link copied to clipboard
open override fun disable()

Disable the location provider, listeners will stay subscribed to the engine but not receive any new location updates.

Link copied to clipboard
@RequiresPermission(anyOf = ["android.permission.ACCESS_FINE_LOCATION", "android.permission.ACCESS_COARSE_LOCATION"])
open override fun enable()

Enable the Android location provider. After this, the location provider will notify listeners of new locations according to the engine configuration specified.

Link copied to clipboard

Remove a listener from the location provider, after which the listener will receive no more location updates.

Inherited functions

Link copied to clipboard
open fun addPredictionsUpdateListener(listener: PredictionsUpdateListener)
Link copied to clipboard
open fun removePredictionsUpdateListener(listener: PredictionsUpdateListener)