com.google.api.client.util.Beta
Utilities based on Google
Play services.
Classes
GoogleAccountCredential
Beta
Manages authorization and account selection for Google accounts.
When fetching a token, any thrown GoogleAuthException would be wrapped:
- GooglePlayServicesAvailabilityException would be wrapped inside of GooglePlayServicesAvailabilityIOException
- UserRecoverableAuthException would be wrapped inside of UserRecoverableAuthIOException
- GoogleAuthException when be wrapped inside of GoogleAuthIOException
Upgrade warning: in prior version 1.14 exponential back-off was enabled by default when I/O exception was thrown inside #getToken, but starting with version 1.15 you need to call #setBackOff with ExponentialBackOff to enable it.
Exceptions
GoogleAuthIOException
Beta
Wraps a GoogleAuthException into an IOException so it can be caught directly.
Use #getCause() to get the wrapped GoogleAuthException.
GooglePlayServicesAvailabilityIOException
Beta
Wraps a GooglePlayServicesAvailabilityException into an IOException so it can be
caught directly.
Use #getConnectionStatusCode() to display the error dialog. Alternatively, use #getCause() to get the wrapped GooglePlayServicesAvailabilityException. Example usage:
catch (final GooglePlayServicesAvailabilityIOException availabilityException) {
myActivity.runOnUiThread(new Runnable() {
public void run() {
Dialog dialog = GooglePlayServicesUtil.getErrorDialog(
availabilityException.getConnectionStatusCode(),
myActivity, MyActivity.REQUEST_GOOGLE_PLAY_SERVICES);
dialog.show();
}
}
UserRecoverableAuthIOException
Beta
Wraps a UserRecoverableAuthException into an IOException so it can be caught
directly.
Use #getIntent() to allow user interaction to recover. Alternatively, use #getCause() to get the wrapped UserRecoverableAuthException. Example usage:
catch (UserRecoverableAuthIOException userRecoverableException) {
myActivity.startActivityForResult(
userRecoverableException.getIntent(), MyActivity.REQUEST_AUTHORIZATION);
}
}