1

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);
Mark Rotteveel
  • 100,966
  • 191
  • 140
  • 197
  • Does this answer your question? ['com.google.android.gms.common.api.GoogleApiClient' is deprecated](https://stackoverflow.com/questions/57575770/com-google-android-gms-common-api-googleapiclient-is-deprecated) – Suraj Bahadur Oct 08 '20 at 07:01
  • @SurajBahadur Thank you. I'm using Google Maps, so I didn't have a big problem even if I didn't use this version of api simply. Thank you for your answer. ^^ – 나비이쁜이 Mar 02 '21 at 06:15

0 Answers0