Location Info

The library for determining the real geographic location of device.

Permissions

Permissions=Location;Internet

Dependency libraries

  • Qt5Core
  • Qt5Positioning

Features

  • Check is supported.
  • Gets the available positioning methods.
  • Listen to positions with their time, altitude, horizontal and vertical accuracy, speed and direction.
  • Choose positioning accuracy: Balanced or High (satellite).
  • Positioning errors.

Example

val id = LocationInfo.listen(
    accuracy = LocationAccuracy.High,                             // Balanced (the default) allows other methods
    onError = { error -> println("positioning failed: $error") }, // AccessDenied, Closed, Unavailable, Unknown
) { _, state ->
    println("${state.latitude}, ${state.longitude} ±${state.horizontalAccuracy ?: "?"} m at ${state.timestamp}")
}

LocationInfo.unlisten(id)