I have an Android app that uses Fused provider and reports lng,lat,accuracy every 3 seconds.
While driving in a vehicle and building a route from the reported samples we can see that from time to time, the GPS provides bad longitude while accuracy is the same as for valid points (about 20).
It happens on the same device (Huawei P Smart) and in different locations in the world.
Does anyone have an idea what it is?
Example 1:
Zoom In:
Zoom Out:
Example 2:
Zoom In:
Zoom Out:
Code:
private lateinit var fusedLocationClient: FusedLocationProviderClient
private val locationRequest by lazy {
interval = 4000
fastestInterval = 2000
priority = LocationRequest.PRIORITY_HIGH_ACCURACY
}
private var locationCallback: LocationCallback = object : LocationCallback() {
override fun onLocationResult(locationResult: LocationResult) {
super.onLocationResult(locationResult)
//take the following:
locationResult.lastLocation.latitude
locationResult.lastLocation.longitude
locationResult.lastLocation.accuracy
}
}
...
fusedLocationClient.requestLocationUpdates(locationRequest, locationCallback, null)