create

fun create(context: Context, config: LocationProviderConfig = LocationProviderConfig()): LocationProvider

Creates a new instance of LocationProvider that relies on the default Android mechanism to obtain location ( via LocationManager ).

Parameters

context

A context instance.


fun create(context: Context, dispatcher: CoroutineDispatcher, config: LocationProviderConfig = LocationProviderConfig()): LocationProvider

Deprecated

This will be removed from future releases after 2026-07-26.

Replace with

create(context, dispatcher, config, locationInterceptor)

Constructs the LocationProvider with a custom CoroutineDispatcher to handle location listener callbacks on a dedicated thread. This recommended approach for instantiation helps prevent cases where the handling of location updates blocks the main thread.

Parameters

context

A context instance.

dispatcher

The CoroutineDispatcher for handling location listener callbacks.

config

Configuration for LocationProvider.