When should I disable GoogleApiClient (Android)

In my android app, I have 3 login options. Google+, Facebook and my own login option. I have completed all 3.

I have implemented a Google+ login using the steps outlined here. Server side access enabled.

I receive a one-time authorization code and pass it to my own api. Once I got the authorization code, is there any reason for the GoogleApiClient to connect?

I have a similar question for a Facebook session here.


source to share

1 answer

There is no reason to keep in touch with GoogleApiClient unless you plan on directly accessing one of your APIs directly. Once you have an authorization code, you can close the GoogleApiClient if you like.

What are you doing this early? It clears up the glue connection a little earlier and allows you to remove com.google.android.gms from memory (it probably won't be removed from memory anyway anyway on mid-high-end phones) a little earlier.

I wouldn't bother with that. As long as you close GoogleApiClient Activity#onStop

all the way, you should be fine.



All Articles