I just found out that my GPS is returning shorter length latitude and longitude coordinates.
It's returning latitude: 00.0000000
(9 chars)
Instead of: 00.00000000000000
(16 chars),
Due to the length, when I use my Geocoder it returns different names of places. How can I receive full-length coordinates?
Here is the code:
val listenerMain = object : LocationListener {
override fun onLocationChanged(location: Location) {
locationManager.removeUpdates(this)
lastLatitude = location.latitude
lastLongitude = location.longitude
}
override fun onStatusChanged(s: String, i: Int, bundle: Bundle) { }
override fun onProviderEnabled(s: String) { }
override fun onProviderDisabled(s: String) { }
}
locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, 0, 0f, listenerMain)
locationManager.requestLocationUpdates(LocationManager.NETWORK_PROVIDER, 0, 0f, listenerMain)
lastLatitude
and lastLongitude
are 9-chars.