GoogleApiClient 已弃用,新的​​替代方案

Noo*_*r08 0 android google-api

public class DriverMapActivity extends FragmentActivity implements OnMapReadyCallback, GoogleApiClient.ConnectionCallbacks, GoogleApiClient.OnConnectionFailedListener, com.google.android.gms.location.LocationListener {

    private GoogleMap mMap;
    GoogleApiClient mGoogleApiClient;
    Location mLastLocation;
    LocationRequest mLocationRequest;
Run Code Online (Sandbox Code Playgroud)

我遵循了本教程,但所有 GoogleApiClients 都被划掉了,我不明白为什么!

Pro*_*eak 7

使用 GoogleApi 代替 GoogleApiClient:https : //developers.google.com/android/reference/com/google/android/gms/common/api/GoogleApi.html

本指南将引导您完成如何从 GoogleApiClient 过渡到 GoogleApi:https ://android-developers.googleblog.com/2017/11/moving-past-googleapiclient_21.html