>{@code GoogleAuthUtil.getToken()}</a> methods in a foreground activity where you can
display a dialog to the user to interactively handle authentication errors.</li>
display a dialog to the user to interactively handle authorization errors.</li>
<li>Call one of the three <a href="{@docRoot}reference/com/google/android/gms/auth/GoogleAuthUtil.html#getTokenWithNotification(android.content.Context, java.lang.String, java.lang.String, android.os.Bundle)"
>{@code getTokenWithNotification()}</a>
methods if you are authenticating in a background service or sync adapter so that a notification is displayed if an authentication
error occurs.</a></li>
methods if you are trying to gain authorization in a background service or sync adapter so that a
notification is displayed if an error occurs.</a></li>
</ul>
<h3>Using getToken()</h3>
The following code snippet obtains an authentication token with an email address, the scope that you want to use for the service, and a {@link android.content.Context}:
The following code snippet obtains an access token with an email address, the scope that you want to use for the service, and a {@link android.content.Context}:
<pre>
HelloActivity mActivity;
String mEmail;
@@ -90,13 +90,13 @@ try {
<p>Call this method off of the main UI thread since it executes network transactions. An easy way to do this
is in an {@link android.os.AsyncTask}.
The sample in the Google Play services SDK shows you how to wrap this call in an AsyncTask.
If authentication is successful, the token is returned. If not, the exceptions described in
If authorization is successful, the token is returned. If not, the exceptions described in
<a href="#handle">Handling Exceptions</a>
are thrown that you can catch and handle appropriately.
</p>
<h3>Using getTokenWithNotification()</h3>
<p>If you are obtaining authentication tokens in a background service or sync adapter, there
<p>If you are obtaining access tokens in a background service or sync adapter, there