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
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.
Important: This is a Public Preview API. It may be changed or removed at any time.
Parameters
context
A context instance.
dispatcher
The CoroutineDispatcher for handling location listener callbacks.
config
Configuration for LocationProvider.