I am using google drive android api for my application. How do I fetch the access and refresh tokens once I'm connected ? I am thinking to send these tokens to server and perform some operation. Not sure if it's possible. Any help ?
I'd recommend that you give access to your server by implementing the GoogleApiClient.ServerAuthCodeCallbacks interface. It allows you to request an auth code which you can send to your server to exchange for refresh and access tokens.
This is especially useful since you can specify different scopes for your server than for your client (Android) application. See these Google Sign-In docs for an example implementation.
It is possible to get an access token from GoogleApiClient via something like GoogleAccountCredential or GoogleAuthUtil. There is no way of extracting a refresh token from a connected GoogleApiClient.