Hier I gave one example of getting the last known location with FusedLocationProviderClient

Now here is example with LocationManager:

Shortly, I am using this code to receive last known location with LocationManager:

val locationManager = getSystemService(LOCATION_SERVICE) as LocationManager
locationManager.requestLocationUpdates(
	LocationManager.GPS_PROVIDER,
	1000L,
	0f
) { location ->
	logger.log("\nLat: " + location.latitude.toString()
			+ "\nLon: " + location.longitude.toString()
			+ "\nAltitude" + location.altitude.toString())
}