通过android中的位置获得每小时英里的速度

通过android中的位置获得每小时英里的速度,android,kotlin,Android,Kotlin,我想以每小时英里的速度通过这个位置。如何从以下代码中获取MPH速度 val locationListener: LocationListener = object : LocationListener { override fun onLocationChanged(location: Location) { location.latitude Toast.makeText( this@MainAct

我想以每小时英里的速度通过这个位置。如何从以下代码中获取MPH速度

val locationListener: LocationListener = object : LocationListener {
        override fun onLocationChanged(location: Location) {
            location.latitude
            Toast.makeText(
                this@MainActivity, "Current speed:" + location.speed,
                Toast.LENGTH_SHORT
            ).show()
        }

        override fun onStatusChanged(
            provider: String, status: Int,
            extras: Bundle
        ) {
        }

        override fun onProviderEnabled(provider: String) {}
        override fun onProviderDisabled(provider: String) {}
    }
    locationManager.requestLocationUpdates(
        LocationManager.GPS_PROVIDER,
        0,
        0f,
        locationListener
    )

你是在问如何将米/秒转换成英里/小时吗?这不是一个真正的编程问题。