如何使用更新的“ GoogleApi”优化具有“ GoogleApiClient”的Google Maps的旧教程?

问题描述 投票:0回答:1

我一直在尝试制作出租车服务项目。当我被撞到某个地方时,我借助了YouTube上提供的各种教程的帮助。但是,视频中使用的是完全不同的方法,因为它们是1年前或2年前制作的。当时GoogleApiClient用于Google Play服务,但是现在我无法在android studio中使用GoogleAPIClient。

java android-studio google-maps google-api-client
1个回答
0
投票

优化(或重新制作)教程不是您的问题。对于本教程的作者/制作者来说,这是个问题。

建议:

  1. 寻找基于较新API的较新教程

  2. 比较这两个Google开发人员指南页面,分别说明新方法和旧方法:

新方法的一般模式是在将为客户端提供服务的服务类上调用静态方法;例如

    FusedLocationProviderClient client =
        LocationServices.getFusedLocationProviderClient(this);

or

    GoogleSignInAccount account = GoogleSignIn.getLastSignedInAccount(this);
    DriveResourceClient client = Drive.getDriveResourceClient(this, account);

期望每个Google服务的文档将提供获取其客户的示例。这可能只是查找和阅读您要使用的服务的文档的问题。

© www.soinside.com 2019 - 2024. All rights reserved.