Example usage for com.google.api.client.googleapis.extensions.android.accounts GoogleAccountManager ACCOUNT_TYPE

List of usage examples for com.google.api.client.googleapis.extensions.android.accounts GoogleAccountManager ACCOUNT_TYPE

Introduction

In this page you can find the example usage for com.google.api.client.googleapis.extensions.android.accounts GoogleAccountManager ACCOUNT_TYPE.

Prototype

String ACCOUNT_TYPE

To view the source code for com.google.api.client.googleapis.extensions.android.accounts GoogleAccountManager ACCOUNT_TYPE.

Click Source Link

Document

Google account type.

Usage

From source file:cl.chileagil.agileday2012.fragment.MainFragment.java

License:Open Source License

private void chooseAccount() {
    accountManager.getAccountManager().getAuthTokenByFeatures(GoogleAccountManager.ACCOUNT_TYPE,
            AUTH_TOKEN_TYPE, null, MainFragment.this, null, null, new AccountManagerCallback<Bundle>() {

                public void run(AccountManagerFuture<Bundle> future) {
                    Bundle bundle;//from  w w w  . j  av a2 s  .  co  m
                    try {
                        bundle = future.getResult();
                        setAccountName(bundle.getString(AccountManager.KEY_ACCOUNT_NAME));
                        setAuthToken(bundle.getString(AccountManager.KEY_AUTHTOKEN));
                        onAuthToken();
                    } catch (OperationCanceledException e) {
                        // user canceled
                    } catch (AuthenticatorException e) {
                        Log.e(TAG, e.getMessage(), e);
                    } catch (IOException e) {
                        Log.e(TAG, e.getMessage(), e);
                    }
                }
            }, null);
}

From source file:com.github.andlyticsproject.adsense.BackgroundGoogleAccountCredential.java

License:Apache License

/**
 * Returns an intent to show the user to select a Google account, or create a new one if there
 * are//from   w w  w.  j a  va 2 s  . com
 * none on the device yet.
 * 
 * <p>
 * Must be run from the main UI thread.
 * </p>
 */
public final Intent newChooseAccountIntent() {
    return AccountPicker.newChooseAccountIntent(selectedAccount, null,
            new String[] { GoogleAccountManager.ACCOUNT_TYPE }, true, null, null, null, null);
}

From source file:de.hwrberlin.app.prostapp.g2.CalendarSample.java

License:Apache License

private void chooseAccount() {
    accountManager.getAccountManager().getAuthTokenByFeatures(GoogleAccountManager.ACCOUNT_TYPE,
            AUTH_TOKEN_TYPE, null, CalendarSample.this, null, null, new AccountManagerCallback<Bundle>() {

                public void run(AccountManagerFuture<Bundle> future) {
                    Bundle bundle;/*from   w w w .  ja  v  a  2 s  .c  o  m*/
                    try {
                        bundle = future.getResult();
                        setAccountName(bundle.getString(AccountManager.KEY_ACCOUNT_NAME));
                        setAuthToken(bundle.getString(AccountManager.KEY_AUTHTOKEN));
                        onAuthToken();
                    } catch (OperationCanceledException e) {
                        // user canceled
                    } catch (AuthenticatorException e) {
                        Log.e(TAG, e.getMessage(), e);
                    } catch (IOException e) {
                        Log.e(TAG, e.getMessage(), e);
                    }
                }
            }, null);
}

From source file:de.hwrberlin.app.prostapp.g2.GoogleCalendarConnection.java

License:Apache License

private void chooseAccount() {
    accountManager.getAccountManager().getAuthTokenByFeatures(GoogleAccountManager.ACCOUNT_TYPE,
            AUTH_TOKEN_TYPE, null, GoogleCalendarConnection.this, null, null,
            new AccountManagerCallback<Bundle>() {

                public void run(AccountManagerFuture<Bundle> future) {
                    Bundle bundle;//  ww w .  j ava 2s  .co  m
                    try {
                        bundle = future.getResult();
                        setAccountName(bundle.getString(AccountManager.KEY_ACCOUNT_NAME));
                        setAuthToken(bundle.getString(AccountManager.KEY_AUTHTOKEN));
                        onAuthToken();
                    } catch (OperationCanceledException e) {
                        // user canceled
                    } catch (AuthenticatorException e) {
                        Log.e(TAG, e.getMessage(), e);
                    } catch (IOException e) {
                        Log.e(TAG, e.getMessage(), e);
                    }
                }
            }, null);
}