當前位置: 首頁>>代碼示例>>Java>>正文


Java GoogleAuthUtil.GOOGLE_ACCOUNT_TYPE屬性代碼示例

本文整理匯總了Java中com.google.android.gms.auth.GoogleAuthUtil.GOOGLE_ACCOUNT_TYPE屬性的典型用法代碼示例。如果您正苦於以下問題:Java GoogleAuthUtil.GOOGLE_ACCOUNT_TYPE屬性的具體用法?Java GoogleAuthUtil.GOOGLE_ACCOUNT_TYPE怎麽用?Java GoogleAuthUtil.GOOGLE_ACCOUNT_TYPE使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在com.google.android.gms.auth.GoogleAuthUtil的用法示例。


在下文中一共展示了GoogleAuthUtil.GOOGLE_ACCOUNT_TYPE屬性的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: onAuthSuccess

/**
 * Called when authentication succeeds. This may either happen because the user just
 * authenticated for the first time (and went through the sign in flow), or because it's
 * a returning user.
 *
 * @param accountName        name of the account that just authenticated successfully.
 * @param newlyAuthenticated If true, this user just authenticated for the first time.
 *                           If false, it's a returning user.
 */
@Override
public void onAuthSuccess(String accountName, boolean newlyAuthenticated) {
    Account account = new Account(accountName, GoogleAuthUtil.GOOGLE_ACCOUNT_TYPE);
    LOGD(TAG, "onAuthSuccess, account " + accountName + ", newlyAuthenticated="
            + newlyAuthenticated);

    refreshAccountDependantData();

    if (newlyAuthenticated) {
        LOGD(TAG, "Enabling auto sync on content provider for account " + accountName);
        SyncHelper.updateSyncInterval(this, account);
        SyncHelper.requestManualSync(account);
    }

    setupAccountBox();
    populateNavDrawer();
    registerGCMClient();
}
 
開發者ID:dreaminglion,項目名稱:iosched-reader,代碼行數:27,代碼來源:BaseActivity.java

示例2: getAccountType

/**
 * Get the account type associated with the install location of the app
 *
 * @return the account type
 */
public static String getAccountType() {
    if (DEBUG) {
        MyLog.i(CLS_NAME, "getAccountType");
    }

    switch (Global.installLocation) {

        case PLAYSTORE:
            if (DEBUG) {
                MyLog.i(CLS_NAME, "getAccountType PLAYSTORE");
            }
            return GoogleAuthUtil.GOOGLE_ACCOUNT_TYPE;
        case AMAZON:
            if (DEBUG) {
                MyLog.i(CLS_NAME, "getAccountType AMAZON");
            }
            return "";
        default:
            return "";
    }
}
 
開發者ID:brandall76,項目名稱:Saiy-PS,代碼行數:26,代碼來源:Install.java

示例3: onAuthSuccess

/**
 * Called when authentication succeeds. This may either happen because the user just
 * authenticated for the first time (and went through the sign in flow), or because it's
 * a returning user.
 * @param accountName name of the account that just authenticated successfully.
 * @param newlyAuthenticated If true, this user just authenticated for the first time.
 * If false, it's a returning user.
 */
@Override
public void onAuthSuccess(String accountName, boolean newlyAuthenticated) {
    Account account = new Account(accountName, GoogleAuthUtil.GOOGLE_ACCOUNT_TYPE);
    LogUtils.LOGD(TAG, "onAuthSuccess, account " + accountName + ", newlyAuthenticated=" + newlyAuthenticated);

    refreshAccountDependantData();

    if (newlyAuthenticated) {
        LogUtils.LOGD(TAG, "Enabling auto sync on content provider for account " + accountName);
        SyncHelper.updateSyncInterval(this, account);
        SyncHelper.requestManualSync(account);
    }

    setupAccountBox();
    populateNavDrawer();
    registerGCMClient();
}
 
開發者ID:The-WebOps-Club,項目名稱:saarang-iosched,代碼行數:25,代碼來源:BaseActivity.java

示例4: onAuthSuccess

/**
 * Called when authentication succeeds. This may either happen because the user just
 * authenticated for the first time (and went through the sign in flow), or because it's
 * a returning user.
 * @param accountName name of the account that just authenticated successfully.
 * @param newlyAuthenticated If true, this user just authenticated for the first time.
 * If false, it's a returning user.
 */
@Override
public void onAuthSuccess(String accountName, boolean newlyAuthenticated) {
    Account account = new Account(accountName, GoogleAuthUtil.GOOGLE_ACCOUNT_TYPE);
    LOGD(TAG, "onAuthSuccess, account " + accountName + ", newlyAuthenticated=" + newlyAuthenticated);

    refreshAccountDependantData();

    if (newlyAuthenticated) {
        LOGD(TAG, "Enabling auto sync on content provider for account " + accountName);
        SyncHelper.updateSyncInterval(this, account);
        SyncHelper.requestManualSync(account);
    }

    setupAccountBox();
    populateNavDrawer();
    registerGCMClient();
}
 
開發者ID:gdg-bh,項目名稱:AppDevFestSudeste2015,代碼行數:25,代碼來源:BaseActivity.java

示例5: getToken

protected void getToken() throws OperationCanceledException,
		AuthenticatorException, IOException {
	// activity.token = null;
	Account account = new Account(toDoFragment.userName,
			GoogleAuthUtil.GOOGLE_ACCOUNT_TYPE);
	AccountManagerFuture<Bundle> accountManagerFuture = AccountManager.get(
			toDoFragment.getActivity()).getAuthToken(account,
			"oauth2:" + TasksScopes.TASKS, null,
			toDoFragment.getActivity(), null, null);
	toDoFragment.token = accountManagerFuture.getResult().getString(
			AccountManager.KEY_AUTHTOKEN);
	// Users user = activity.userDataSource.selectUser(activity.userName);
	// user.setPwd(activity.token);
	if (toDoFragment.token != null && !toDoFragment.token.isEmpty()) {
		// activity.userDataSource.updateUsers(user);
		toDoFragment.credential = (new GoogleCredential())
				.setAccessToken(toDoFragment.token);
	}
}
 
開發者ID:RockyNiu,項目名稱:ToDo,代碼行數:19,代碼來源:ToDoListLoadAsynTask.java

示例6: signin

@Kroll.method
public void signin(KrollDict props)
{
	if (props.containsKey("success")) {
		successCallback = (KrollFunction) props.get("success");
	}
	if (props.containsKey("error")) {
		errorCallback = (KrollFunction) props.get("error");
	}
	

	String[] accountTypes = new String[] { GoogleAuthUtil.GOOGLE_ACCOUNT_TYPE };
	Intent intent = AccountPicker.newChooseAccountIntent(null, null,
			accountTypes, false, null, null, null, null);

	Activity activity = TiApplication.getAppCurrentActivity();
	TiActivitySupport support = (TiActivitySupport) activity;
	requestCode = support.getUniqueResultCode();
	support.launchActivityForResult(intent, requestCode, this);

}
 
開發者ID:Sitata,項目名稱:titanium_google_auth_util,代碼行數:21,代碼來源:TitaniumGoogleAuthUtilModule.java

示例7: getActiveAccount

/**
 * Return the {@code Account} the app is using as the active Google Account.
 *
 * @param context Context used to lookup {@link SharedPreferences} the value is stored with.
 */
public static Account getActiveAccount(final Context context) {
    String account = getActiveAccountName(context);
    if (account != null) {
        return new Account(account, GoogleAuthUtil.GOOGLE_ACCOUNT_TYPE);
    } else {
        return null;
    }
}
 
開發者ID:dreaminglion,項目名稱:iosched-reader,代碼行數:13,代碼來源:AccountUtils.java

示例8: getActiveAccount

public static Account getActiveAccount(final Context context) {
    String account = getActiveAccountName(context);
    if (account != null) {
        return new Account(account, GoogleAuthUtil.GOOGLE_ACCOUNT_TYPE);
    } else {
        return null;
    }
}
 
開發者ID:ramonrabello,項目名稱:devfestnorte-app,代碼行數:8,代碼來源:AccountUtils.java

示例9: pickUserAccount

private void pickUserAccount() {
    String[] accountTypes = new String[]{GoogleAuthUtil.GOOGLE_ACCOUNT_TYPE};
    Intent intent = AccountPicker.newChooseAccountIntent(null, null,
            accountTypes, false, null, null, null, null);
    startActivityForResult(intent, REQUEST_CODE_PICK_ACCOUNT);
}
 
開發者ID:Truiton,項目名稱:CloudVisionAPI,代碼行數:6,代碼來源:MainActivity.java

示例10: getAccountType

/**
 * @return
 */
protected String getAccountType() {
    return GoogleAuthUtil.GOOGLE_ACCOUNT_TYPE;
}
 
開發者ID:remelpugh,項目名稱:android-shared,代碼行數:6,代碼來源:BaseNavigationDrawerActivity.java


注:本文中的com.google.android.gms.auth.GoogleAuthUtil.GOOGLE_ACCOUNT_TYPE屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。