问题标签 [fusedlocationproviderapi]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
2 回答
1299 浏览

android - 定位客户端对 setInterval、setFastestInterval 和 setSmallestDisplacement 的优先级?

如果

已给出,那么何时会调用更新?如果用户在 60 秒内移动了 10 米,是否会调用位置更新?或者如果用户在 60 秒内没有移动任何距离,是否可以获取更新?如果一次使用所有属性,哪个将被优先考虑?

我在我的应用程序中使用了所有这些。但是,它只有在位移为 1mt 且间隔为 30secs 时才有效。当位移增加到 20 米并保持间隔不变时,得到了更奇怪的结果。

0 投票
1 回答
10957 浏览

android - Android 播放服务 6.5:LocationClient 缺失

更新到 Google Play Services 6.5.87 后,由于缺少 LocationCLient 类,我的应用程序无法编译。

文档链接目前 已损坏(404 Not Found)

我该如何解决?我想接收位置更新、使用地理围栏等。

0 投票
1 回答
86 浏览

android - LocationListener VS FusedLocation 的不同坐标

我注意到LocationListenerFusedLocation(与 GPS 一起使用,由 PRIORITY_HIGH_ACCURACY 使用)检索不同的坐标。

LocationListener8 位小数返回纬度,而不是FusedLocation7 位或有时 6 位小数返回纬度:小数点似乎四舍五入,导致精度降低。

使用 PlayServices:6.1.11 在我的 Moto X/KitKat 上测试

有谁知道为什么?有没有一种方法可以使用 FusedLocation 而没有四舍五入的结果?

谢谢。

编辑 getAccuracy 检索到的准确性是相同的。

0 投票
1 回答
156 浏览

android - GoogleApiClient keeps GPS radio on

I have been working on utilizing the FusedLocationProviderApi in my android application, however whenever I create the GoogleApiClient as follows:

The fine location icon in the notification bar turns on before I even call connect on the the client. The contexts I tried this with included activity and application scoped contexts, both yielded the same result.

My problem is that this seems to be keeping the phone awake wasting battery for no reason. The documentation does not mention anything regarding this as far as I could tell.

0 投票
2 回答
3693 浏览

android - Android: How do I remove a request with LocationRequest?

Im using Google Play Services, Fused Location Provider and LocationRequest to get the current location.

I would like to know how do I go about cancelling a request in progress? As stated by documentation when I call setNumUpdates() and pass 1, I must set an expiration which is fine while the app is running but what if I go to paused state? How can I explicitly cancel the request as the docs mention as soon as paused state occurs?

Thanks for reading

0 投票
0 回答
128 浏览

android - FusedLocationProvider 在打开 GPS 的情况下更快地找到位置

我的 android 应用程序依赖于位置。但是,我将其用作抽象层的 FusedLocationProvider,这样我就不必担心要使用什么 LocationProvider,它的行为出乎意料。

场景:用户打开应用程序。我检查提供商的可用性并打开位置设置页面。用户启用“访问我的位置”以及 GPS 和 Wi-Fi 位置。当用户返回应用程序时,我没有收到任何位置更新。

当我关闭 GPS 并在系统设置中只允许 Wi-Fi 时,我会得到一个更新的位置。

我尝试了优先级PRIORITY_LOW_POWERPRIORITY_BALANCED_POWER_ACCURACY当 GPS 关闭时,两者都没有给我位置更新。

它是怎么来的,位置检测在 GPS 关闭时有效,而在 GPS 开启时无效?这有任何意义吗?

当 GPS 关闭时,我获得的位置对于应用程序正在执行的操作来说足够准确。如果设备已长时间打开 LocationServices(包括手机在外面),即使打开 GPS,我也会收到位置更新。

有人对此有解释/知道如何解决这个问题吗?

0 投票
2 回答
4823 浏览

android - Fused Location API 在地图中绘制时会给出不准确的纬度和长度,即使精度值较低,它也会稍微远离道路路径

Google 提供了融合位置提供者 API 来获取位置坐标。根据文档,API 在内部轮询来自不同提供商(GPS、Wifi、蜂窝网络)的位置数据并提供最佳位置。但是,在高精度模式下,我收集了以下信息。在此测试中,GPS 始终处于开启状态。

当我在地图上看到这个点时,这些点不在路上。他们离马路稍远。其他具有相同精度的点绘制在道路上。当我完全放大并看到时,一些点稍微远离行驶的道路路径。

我想要准确的信息。它的点必须在道路路径中。

我使用了Fused Location API来获取位置信息。

分享你的建议。如果我使用位置管理器,它将解决我的问题。而且我只需要消耗更少的电池。Fused API 保证它只消耗更少的功率和更高的效率。

Fused Location API 也有以下问题,

  1. 无法获得卫星计数。
  2. 始终返回 FUSED 提供程序。不完全给出哪个提供商(GPS 或网络)返回位置信息。
  3. 当两个提供商都不可用时,您永远不会通知。当没有提供者可用时,它不会返回任何值。要检查供应商的可用性,我们需要单独向位置管理器注册。这会消耗更多的电量。

请帮助我。提前致谢。

0 投票
1 回答
1755 浏览

android - 如何从融合位置 api 中获取卫星数量?

我正在使用 GoogleApiClient 请求位置更新。我正在获取纬度、经度、速度和其他信息。除此之外,我还想获得卫星数量。我怎样才能做到这一点?

请帮助我。

0 投票
3 回答
3556 浏览

android - 在应用启动时获取位置地址

我需要应用程序启动时的位置。我正在使用 fusedlocationapi 跟踪这个 tut 以获取 LastLocation: https ://developer.android.com/training/location/retrieve-current.html

当通过按钮执行用于查找地址的 AsyncTask 时,它工作得很好,但是当我将相同的片段放在 oncreate 或 onstart 中时,就会得到 NPE,可能是因为它需要很长时间才能修复位置。

我希望加载活动,显示 ProgressBar 然后显示位置,而无需单击按钮。

一种解决方法是在 onstart 短暂延迟后执行 AsyncTask,但我猜测应该有更有效的方法。

0 投票
2 回答
10549 浏览

android - Android Fused Location API. Location Always null

I am trying to implement fused location for getting the current location. I am doing it with the help of this link

My googleAPiCLient is connected. But location is always null

In my Manifest file I have put this

I created a seperate Fusionclass.

MY fusion class--

}

My activity class I am calling the FusedLOcation class from the oncreate

Location is always null. The listeners do not seem to be working.