android - Android 中 PowerRequirement (Location) 的含义

标签 android geolocation location

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/

相关文章:

android - Android webview 和浏览器上的地理定位失败

ios - 仅以英文获取用户的城市

android - 如何通过 Volley 在中间停止 Web API 执行

android - 如何在Android Studio 2.0中激活Instant Run

java - gomobile如何在apk中嵌入资源

android - 使用 Google Place API 的 AutoCompleteTextView 不起作用

c# - ElasticSearch 索引通过 REST API 工作,但不是 C# 代码

python - 有没有python模块,可以把地理坐标转成对应城市的名字?

javascript - 如果输入值为字符串,则更改窗口位置

Android 位置将纬度和经度从 DMS 格式更改为 double