使用 Google Play Services Location API 获取位置与使用 Awareness API 获取位置

Getting location with the Google Play Services Location API vs getting it with the Awareness API

我读过许多关于 Android 的框架位置 API 和 Google Play 服务位置 API 的比较。但是,与 Google Play Services Location API 相比,使用(专门用于获取位置)Google Play Services Awareness API 有什么好处吗?

这实际上取决于您的具体用例和要求。

  • 如果您只需要知道位置或希望定期接收位置更新,请使用 LocationServices.FusedLocationApi

  • 如果您有更复杂的上下文要求,例如您需要知道用户何时开始行走,或者当用户进入一个区域,或者其他基于用户的 context 的东西,你想要使用 Awareness API.

回答你的问题

However, is there any benefit in using (exclusively to obtain location) the Google Play Services Awareness API over the Google Play Services Location API?

不,根本none。 Awareness API 并不是专门为了获取位置而创建的。 LocationServices.FusedLocationApi 但是,所以使用它。