In a tutorial I'm watching the instructor uses GoogleApiClient for LocationServices like this.
I know that GoogleApiClient is deprecated and we should use GoogleApi instead which incorporates all the Google Api's as per this article: https://android-developers.googleblog.com/2017/11/moving-past-googleapiclient_21.html
However, this article only talks about GoogleSignInClient and not location services at all.
My problems are as follows:
- I cannot find anything when I even try using GoogleSignInClient. My only dependency is this:
implementation 'com.google.android.gms:play-services-location:18.0.0'
By this I mean when I type: private GoogleSignInClient googleSignInClient
...nothing shows up.
- I can't find any GoogleApi for location services(as expected, since even GoogleSignInClient isn't showing up)
What may be going wrong here?
UPDATE:
So his code looks something like this:
private GoogleApiClient googleApiClient;
private FusedLocationProviderClient fusedLocationProviderClient;
fusedLocationProviderClient = LocationServices.getFusedLocationProviderClient(MainActivity.this);
googleApiClient = new GoogleApiClient.Builder(this)
.addApi(LocationServices.API)
.addOnConnectionFailedListener(this)
.addConnectionCallbacks(this)
.build();
..but I need to translate it using GoogleApi instead of GoogleApiClient(since that's deprecated).
Thank you!