Best code examples for Android AccountManager class (android.accounts.AccountManager)

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Android AccountManager class.
You can now enable Codota on your own code to easily search and navigate your Java codebase.

Android AccountManager examples from Open Source projects
This code example shows how to use the following methods: get
72:	final AccountManager manager = AccountManager.get(activity); 
73:	final Account account = AccountUtils.getAccount(manager, activity); 
-
84:	&& AccountUtils.updateAccount(account, activity)) 
Full Snippet Info
9
CodeRank
This code example shows how to use the following methods: get
72:	final AccountManager manager = AccountManager.get(activity); 
-
75:	account = AccountUtils.getAccount(manager, activity); 
Full Snippet Info
8
CodeRank
This code example shows how to use the following methods: get
32:	Activity a = new Activity(); 
33:	assertThat(AccountManager.get(a)).isNotNull(); 
34:	assertThat(AccountManager.get(a)).isNotSameAs(appAM); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: getPassword
66:	return manager.getPassword(account); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: addAccount, putParcelable
144:	Bundle addAccountOptions = new Bundle(); 
-
146:	addAccountOptions.putParcelable(KEY_CALLER_IDENTITY, mPendingIntent); 
147:	AccountManager.get(this).addAccount( 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: setUserData
131:	accountManager.setUserData(account, "account.guid", TEST_GUID); 
132:	accountManager.setUserData(account, "account.clientName", TEST_CLIENT_NAME); 
133:	accountManager.setUserData(account, "account.numClients", new Long(TEST_NUM_CLIENTS).toString()); 
-
185:	assertEquals(NUM_ACCOUNTS, PublicMigrator.upgradeAndroidAccount0to1(accountManager, account, a)); 
-
187:	assertEquals(NUM_ACCOUNTS, PublicMigrator.downgradeAndroidAccount1to0(a, accountManager, account)); 
-
189:	TestSyncAccounts.deleteAccount(this, accountManager, account); 
-
192:	assertEquals(NUM_ACCOUNTS, PublicMigrator.downgradeAndroidAccount1to0(a, accountManager, account)); 
193:	assertEquals(NUM_ACCOUNTS, PublicMigrator.upgradeAndroidAccount0to1(accountManager, account, b)); 
-
197:	TestSyncAccounts.deleteAccount(this, accountManager, account); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: getAccountsByType
40:	Account[] accounts = accountManager.getAccountsByType("com.google"); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: getAccountsByType
61:	TEST_CLUSTER_URL, TEST_CLIENT_NAME, TEST_CLIENT_GUID); 
62:	numAccounts = accountManager.getAccountsByType(TEST_ACCOUNTTYPE).length; 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: addAccountExplicitly
56:	final Account account = new Account(options.getString(OPTIONS_USERNAME), 
-
58:	AccountManager.get(EasTestAuthenticatorService.this).addAccountExplicitly( 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: addAccount, getAccountsByType, getAuthToken
115:	accountManager.addAccount(getAccountType(), 
-
124:	accountManager.getAuthToken(acc, AccountManager.KEY_AUTHTOKEN, 
-
188:	Account[] accounts = accountManager.getAccountsByType(getAccountType()); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: getAccountsByType
37:	Account[] githubAccounts = accountManager.getAccountsByType(ACCOUNT_TYPE_GITHUB); 
38:	Account[] twitterAccounts = accountManager.getAccountsByType(ACCOUNT_TYPE_TWITTER); 
39:	Account[] facebookAccounts = accountManager.getAccountsByType(ACCOUNT_TYPE_FACEBOOK); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: get, getApplicationContext
41:	mContext = context.getApplicationContext(); 
42:	mAccountManager = AccountManager.get(mContext); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: getAccountsByType, getAuthToken, invalidateAuthToken
36:	Account account = accountManager.getAccountsByType(ACCOUNT_TYPE)[0]; 
-
38:	accountManagerFuture = accountManager.getAuthToken(account, AUTH_TOKEN_TYPE, true, null, null); 
39:	accountManager.invalidateAuthToken(ACCOUNT_TYPE, 
-
41:	accountManagerFuture = accountManager.getAuthToken(account, AUTH_TOKEN_TYPE, true, null, null); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: getPassword
80:	Uri uri = Uri.parse(AccountUtils.constructFullURLForAccount(context, account)); 
-
84:	String password = AccountManager.get(context).getPassword(account); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: getAuthToken, invalidateAuthToken
98:	accountManager.invalidateAuthToken(ACCOUNT_TYPE, authToken); 
-
145:	future = accountManager.getAuthToken(account, service, null, activity, null, null); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: getAuthToken, invalidateAuthToken
219:	accountManager.invalidateAuthToken("ah", authToken); 
-
227:	AccountManagerFuture<Bundle> accountManagerFuture = accountManager.getAuthToken(account, "ah", 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: setUserData
182:	mAccountManager.setUserData(account, SYNC_MARKER_KEY, Long.toString(marker)); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: getAuthToken, invalidateAuthToken
28:	manager.invalidateAuthToken(account.type, token); 
-
34:	AccountManagerFuture<Bundle> future = manager.getAuthToken(account, "ah", null, activity, 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: getAuthToken
131:	mAccountManager.getAuthToken( 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: getAuthToken
87:	accountManager.getAuthToken(account, AUTH_TOKEN_TYPE, null, this, new AccountManagerCallback<Bundle>() { 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: getAccountsByType
61:	TEST_CLUSTER_URL, TEST_CLIENT_NAME, TEST_CLIENT_GUID); 
62:	numAccounts = accountManager.getAccountsByType(TEST_ACCOUNTTYPE).length; 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: getAuthToken
131:	mAccountManager.getAuthToken( 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: getAccountsByType
62:	TEST_CLUSTER_URL, TEST_CLIENT_NAME, TEST_CLIENT_GUID); 
63:	numAccounts = accountManager.getAccountsByType(TEST_ACCOUNTTYPE).length; 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: getUserData, setUserData
29:	String data = am.getUserData(account, key); 
-
33:	am.setUserData(account, key, Boolean.toString(defaultValue)); 
-
36:	am.setUserData(account, key, Boolean.toString(defaultValue)); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: blockingGetAuthToken, invalidateAuthToken
122:	authToken = am.blockingGetAuthToken(account, "", true); 
-
152:	am.invalidateAuthToken(Constants.ACCOUNT_TYPE, authToken); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: addAccountExplicitly, setAuthToken
109:	mAccountManager.addAccountExplicitly(account, accountPassword, null); 
110:	mAccountManager.setAuthToken(account, authtokenType, authtoken); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: addAccountExplicitly
68:	final Account account = new Account(options.getString(OPTIONS_USERNAME), ANDROID_ACCOUNT_TYPE); 
69:	AccountManager.get(AuthenticatorService.this).addAccountExplicitly( 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: getPassword, getUserData
43:	String result = accountManager.getUserData(account, EXTRA_NAME); 
-
50:	String result = accountManager.getUserData(account, EXTRA_EMAIL_ADDRESS); 
-
57:	String result = accountManager.getPassword(account); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: addOnAccountsUpdatedListener
51:	private final Handler oauthHandler = new Handler(); 
-
66:	AccountManager.get(context).addOnAccountsUpdatedListener(this, oauthHandler, true); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: getAccountsByType, getAuthToken
41:	final Account[] accounts = accountManager.getAccountsByType(TWITTER_ACCOUNT_TYPE); 
-
51:	response = accountManager.getAuthToken(account, TWITTER_ACCOUNT_TOKEN, null, this, null, null); 
-
70:	response = accountManager.getAuthToken(account, TWITTER_ACCOUNT_SECRET, null, this, null, null); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: setUserData
30:	this.mAM.setUserData(pAcc, sKey_Document, pDcto); 
31:	this.mAM.setUserData(pAcc, sKey_Security, pSegu); 
32:	this.mAM.setUserData(pAcc, sKey_AccountType, pTipo); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: blockingGetAuthToken
64:	assertNull(accountManager.blockingGetAuthToken(account, "BAD_TOKEN_TYPE", false)); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: getAuthToken
137:	return am.getAuthToken(account, authTokenType, null, false, null, null); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: getUserData
119:	this.host = accManager.getUserData(account, "host"); 
-
122:	p = Integer.parseInt(accManager.getUserData(account, "port")); 
-
129:	ssl = Boolean.parseBoolean(accManager.getUserData(account, "useSSL")); 
-
137:	.parseBoolean(accManager.getUserData(account, "useStartTLS")); 
-
142:	this.bindDN = (accManager.getUserData(account, "bindDN") == null) 
143:	|| (accManager.getUserData(account, "bindDN").length() == 0) ? null 
144:	: accManager.getUserData(account, "bindDN"); 
145:	this.bindPW = (accManager.getUserData(account, "bindPW") == null) 
146:	|| (accManager.getUserData(account, "bindPW").length() == 0) ? null 
147:	: accManager.getUserData(account, "bindPW"); 
148:	this.baseDN = accManager.getUserData(account, "baseDN") == null ? "" 
149:	: accManager.getUserData(account, "baseDN"); 
150:	this.filter = accManager.getUserData(account, "filter") == null ? "" 
151:	: accManager.getUserData(account, "filter"); 
-
153:	String syncMan = accManager.getUserData(account, "manualSync"); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: addAccountExplicitly
56:	final Account account = new Account(options.getString(OPTIONS_USERNAME), 
-
58:	AccountManager.get(EasTestAuthenticatorService.this).addAccountExplicitly( 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: getAccountsByType
23:	Account[] accounts = accountManager.getAccountsByType("com.google"); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: getAccountsByType
24:	Account[] accounts = accountManager.getAccountsByType("com.google"); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: getAccountsByType
352:	Account[] accounts = mAccountManager.getAccountsByType("com.google"); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: invalidateAuthToken
62:	am.invalidateAuthToken(GOOGLE_ACCOUNT_TYPE, authToken); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: blockingGetAuthToken, invalidateAuthToken
90:	am.invalidateAuthToken(acc.type, token); 
-
93:	token = am.blockingGetAuthToken(acc, type, true); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: invalidateAuthToken
38:	mAccountManager.invalidateAuthToken(mCurrentAccountType, mLastAuthToken); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: addAccountExplicitly
127:	am.addAccountExplicitly(account, password, null); 
Full Snippet Info
5
CodeRank
Related Android AccountManager Questions & Answers:
See Code Examples for Android AccountManager Methods: