gpt4 book ai didi

`et`的Android.Location.toString()解释

转载 作者:太空狗 更新时间:2023-10-29 16:35:45 25 4
gpt4 key购买 nike

当我在 Location 对象上使用 .toString() 方法时,我得到如下结果:

Location[gps 01.234567,12.234567 
acc=14
et=+2d23h36m34s870ms
alt=123.0
vel=0.0
{Bundle[mParcelledData.dataSize=40]}
]

(我添加了换行符以提高可读性)

我猜(经过这里的一些研究:link):

  • acc=14 是以米为单位的精度
  • vel=0 是以米/秒为单位的速度
  • alt=123 是 WGS 引用椭球上方的高度(以米为单位)

但是 et=+2d23h36m34s870ms 是什么?

最佳答案

根据 javadocs:

/** * Return the time of this fix, in elapsed real-time since system boot. * *

This value can be reliably compared to * {@link android.os.SystemClock#elapsedRealtimeNanos}, * to calculate the age of a fix and to compare Location fixes. This * is reliable because elapsed real-time is guaranteed monotonic for * each system boot and continues to increment even when the system * is in deep sleep (unlike {@link #getTime}. * *

All locations generated by the {@link LocationManager} * are guaranteed to have a valid elapsed real-time. * * @return elapsed real-time of fix, in nanoseconds since system boot. */

public long getElapsedRealtimeNanos() {
return mElapsedRealtimeNanos;
}

toStringet

相关的代码
if (mElapsedRealtimeNanos == 0) {
s.append(" et=?!?");
} else {
s.append(" et=");
TimeUtils.formatDuration(mElapsedRealtimeNanos / 1000000L, s);
}

顺便说一句,它的意思可能是自上次更新位置以来已经过了多长时间

关于 `et`的Android.Location.toString()解释,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29321353/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com