我对它们两者感到困惑,哪一个是最好的 GoogleApiClient 或 FusedLocationProviderClient

I am confuse between both of them which one is the best GoogleApiClient or FusedLocationProviderClient

我对它们两者感到困惑,哪个是最好的 GoogleApiClient 或 FusedLocationProviderClient。有些人使用 GoogleApiClient,有些人使用 FusedLocationProviderClient.I 我很困惑哪一个是最好的我是初学者,我很困惑请帮助我。

您可以使用 GoogleA​​piClient ("Google API Client") 对象访问 Google API 中提供的 Google Play 服务库(例如作为 Google 登录、游戏、驱动器和位置)。因此,为了获得位置,首先需要连接到 google 播放服务,这需要您编写一些样板代码来管理连接,有时会导致错误。即使您没有使用定位服务,您也需要连接到 google 播放服务。

FusedLocationProviderClient 提供改进和更简单的 api,仅在侦听器的帮助下为您的应用程序提供定位功能。它自己处理连接。新的 API 会自动为您解决某些连接故障,因此您无需编写代码来提示用户更新 Google Play 服务。