FusedLocationProviderApi.getLastLocation 是 HIGH_ACCURACY?

is FusedLocationProviderApi.getLastLocation is HIGH_ACCURACY?

我想问一下 getLastLocation() from FusedLocationProviderApi 是否使用 HIGH_ACCURACCY 获取位置?

当我阅读 documentation 时,它说:

public abstract Location getLastLocation (GoogleApiClient client)

Returns the best most recent location currently available.

If a location is not available, which should happen very rarely, null will be returned. The best accuracy available while respecting the location permissions will be returned.

This method provides a simplified way to get location. It is particularly well suited for applications that do not require an accurate location and that do not want to maintain extra logic for location updates.

最好是否意味着获得最准确的位置?或喜欢使用 LocationRequest.PRIORITY_HIGH_ACCURACY?

自动请求最后位置

getLastLocation 不会创建获取当前位置的新请求。它已经根据之前的位置请求提供了 available/saved 个位置。

这已经 available/saved 位置详细信息基于用户设备上任何 client/app 请求的最后位置数据。

例如:如果用户安装了 Google 地图和 运行,它会为您提供设备的准确位置。在这种情况下,一旦您启动您的应用程序并检查最后位置,它将为您提供高精度的位置。

如果您的设备没有 Google 地图,但另一个应用程序请求的位置更新精度较低,您的 getLastLocation 将 return 那个精度较低的位置。