简体   繁体   English

使用Google Play服务位置API获取位置与使用Awareness API获取位置

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

I've read many good comparisons between Android's framework location API and the Google Play Services Location API. 我已经阅读了Android的框架位置API和Google Play服务位置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? 但是,相对于Google Play服务位置API,使用(专门用于获取位置)Google Play服务意识API有什么好处吗?

It really depends on your exact use case & requirements. 这实际上取决于您的确切用例和要求。

  • If you just need to know the location or want to receive locations updates regularly, go with the LocationServices.FusedLocationApi . 如果您只需要知道位置或想定期接收位置更新,请使用LocationServices.FusedLocationApi

  • If you have more complex, contextual requirements, for example you need to know when a user starts walking, or when a user enters an area, or something else that is based on the context of the user, you want to use the Awareness API. 如果您有更复杂的上下文要求,例如,您需要知道用户何时开始行走,或者用户何时进入某个区域,或者其他基于用户上下文的内容 ,则需要使用Awareness API。

To answer your question 回答你的问题

However, is there any benefit in using (exclusively to obtain location) the Google Play Services Awareness API over the Google Play Services Location API? 但是,相对于Google Play服务位置API,使用(专门用于获取位置)Google Play服务意识API有什么好处吗?

No, none at all. 不,一点都没有。 The Awareness API was not created exclusively with the purpose of obtaining locations. 意识API并不是专门为了获取位置而创建的。 LocationServices.FusedLocationApi was however, so use that. 但是,使用了LocationServices.FusedLocationApi

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM