DefaultLocationProviderFactory

Factory for creating instances of implementation of LocationProvider which relies on the default Android mechanism to obtain location ( via LocationManager ).

Functions

Link copied to clipboard
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 ).

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.