gpt4 book ai didi

android - Android 中 PowerRequirement (Location) 的含义

转载 作者:行者123 更新时间:2023-11-29 00:38:20 26 4
gpt4 key购买 nike

Criteria 类 (http://developer.android.com/reference/android/location/Criteria.html) 具有电源要求标准。但显然没有解释它究竟是如何工作的。有了 ACCURACY 就更清楚了。 ACCURACY_HIGH - 需要 GPS 供应商。 ACCURACY_MEDIUM -WiFi/移动网络。 ACCURACY_Low - 移动网络。但是权力呢?如果它满足准确性要求,为什么我们需要这个标准?例如,如果我询问标准,将使用什么提供者: locationCriteria.Accuracy = Accuracy.Fine; (仅需要 GPS)和信条: locationCriteria.PowerRequirement = Power.Low; (仅需要非 GPS 保护者)

在这些要求下,不应满足任何位置提供者。然而,该程序会尝试使用 GPS 提供商。这一切都不清楚,网络上的任何地方都没有解释。那么我需要深入研究 Android 源代码还是什么?

最佳答案

Not one of the location providers should be meet under these requirements. Nevertheless, the program tries to use the GPS provider.

这在 the getBestProvider() method 上有解释文档。 getBestProvider() —— 几乎所有使用 Criteria 的东西,除了 getProviders() —— 都会放宽限制以试图找到一场比赛。电力需求是第一个放宽的。

关于android - Android 中 PowerRequirement (Location) 的含义,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11221933/

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