LocationProvider

An interface that provides location updates. Note that your implementation of LocationProvider must set isMock extra flag to true in case your locations are not real. To set this flag, use:

Location.Builder#extra(Value.valueOf(hashMapOf(LocationExtraKeys.IS_MOCK to Value.valueOf(true))))

Functions

Link copied to clipboard
abstract fun addLocationObserver(observer: LocationObserver)

Adds LocationObserver that will be notified of new location updates.

abstract fun addLocationObserver(observer: LocationObserver, looper: Looper)

Adds LocationObserver that will be notified of new location updates on a thread, specified by a looper parameter.

Link copied to clipboard

Requests the last available location.

Link copied to clipboard

Removed LocationObserver. The observer will not be notified of new location updates any longer.

Link copied to clipboard
abstract fun removeLocationUpdates(pendingIntent: PendingIntent)

Stop location updates for specified pendingIntent.

Link copied to clipboard
abstract fun requestLocationUpdates(pendingIntent: PendingIntent)

Start location updates.