0

I am using GooglePlayServices for my android application . I will be using Google+ Api & LocationServices Api. So from Google's documentation , I build the GoogleApiClient with addApi(Auth.GOOGLE_SIGN_IN_API), addApi(LocationServices.API). Every time user launches the application , I use Google+ api , but I use the LocationServices in rare cases (once in 100 launches). So what is the best way to implement.

Creating a single GoogleApiClient by adding two Api's ? or
Creating two GoogleApiClient's individually for those two api's?

Sasank Sunkavalli
  • 3,864
  • 5
  • 31
  • 55

1 Answers1

1

add More Api if needed

mGoogleApiClient = new GoogleApiClient.Builder(this)
                .enableAutoManage(this /* FragmentActivity */, this /* OnConnectionFailedListener */)
                .addConnectionCallbacks(this)
                .addOnConnectionFailedListener(this)
                .addApi(LocationServices.API)
                .addApi(Auth.GOOGLE_SIGN_IN_API, gso)
                // Add more APIs, as needed
                .build();
Eggy
  • 522
  • 5
  • 29