I was using GoogleApiClient
to use location information while using Google Maps.
However, it is now deprecated. I looked it up in the official document and found that you should use GoogleApi<O>
.
I tried to create an object, but I don't know how to work on it.
I need your help.
GoogleApiClient - Deprecated
googleApiClientBuilder = new GoogleApiClient.Builder(mContext);
googleApiClientBuilder.addApi(LocationServices.API);
googleApiClientBuilder.addConnectionCallbacks(new GoogleApiClient.ConnectionCallbacks() {
@Override
public void onConnected(@Nullable Bundle bundle) {
createLocationRequest(); // my work
createLocationBuild(); // my work
createLocationSetting(); // my work
}
@Override
public void onConnectionSuspended(int i) {}
});
My working GoogleApi<o>
...
GoogleApi<Api.ApiOptions.NoOptions> googleApi = new GoogleApi<>(mContext, LocationServices.API, Api.ApiOptions.NO_OPTIONS, GoogleApi.Settings.DEFAULT_SETTINGS);