rememberLocationManager

fun rememberLocationManager(accuracy: LocationAccuracy = LocationAccuracy.BALANCED, distanceFilter: Double = 10.0, updateInterval: Long): LocationManager

Use a stable LocationManager with the given options (the equivalent of VisionCamera's useLocationManager).

The LocationManager is kept across recompositions, recreated when an option changes, and closed (which stops its location updates) once it leaves the composition.

val locationManager = rememberLocationManager(accuracy = LocationAccuracy.HIGH)

Parameters

accuracy

The accuracy of location updates.

distanceFilter

The distance the last location has to change in order to fire a new location update, in meters.

updateInterval

The interval in which location updates are requested from the system, in milliseconds (Android only).