Code example for AccountManager

Methods: blockingGetAuthToken

        List<User> users;
        List<Status> statuses;
        String authtoken = null;
        try { 
            // use the account manager to request the credentials 
            authtoken =
                    .blockingGetAuthToken(account, "NovlGameSocial", true /* notifyAuthFailure */);
            // fetch updates from the sample service over the cloud 
            users = NetworkUtilities.fetchFriendUpdates(account, authtoken, mLastUpdated);
            // update the last synced date. 
            mLastUpdated = new Date();
            // update platform contacts. 
            Log.d(TAG, "Calling contactManager's sync contacts");
            ContactManager.syncContacts(mContext,, users);
            // fetch and update status messages for all the synced users. 
            //statuses = NetworkUtilities.fetchFriendStatuses(account, authtoken); 
            //ContactManager.insertStatuses(mContext,, statuses); 
        } catch (final AuthenticatorException e) {
Experience pair programming with AI  Get Codota for Java