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

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

Android Account examples from Open Source projects
This code example shows how to use the following methods:
49:	Account a2 = new Account("name_b", "type_b"); 
50:	Robolectric.shadowOf(am).addAccount(a2); 
-
53:	assertThat(am.getAccounts()[1]).isSameAs(a2); 
Full Snippet Info
8
CodeRank
This code example shows how to use the following methods:
142:	final Account account2 = new Account("b@example.com", "example.type.2"); 
-
179:	engine.setIsSyncable(account2, 0, authority1, 1); 
180:	engine.setSyncAutomatically(account2, 0, authority1, true); 
-
185:	engine.setIsSyncable(account2, 0, authority2, 0); 
186:	engine.setSyncAutomatically(account2, 0, authority2, true); 
-
207:	syncs = engine.getPeriodicSyncs(account2, 0, authority1); 
-
212:	assertEquals(true, engine.getSyncAutomatically(account2, 0, authority1)); 
-
214:	assertEquals(true, engine.getSyncAutomatically(account2, 0, authority2)); 
-
217:	assertEquals(1, engine.getIsSyncable(account2, 0, authority1)); 
-
219:	assertEquals(0, engine.getIsSyncable(account2, 0, authority2)); 
Full Snippet Info
8
CodeRank
This code example shows how to use the following methods:
36:	GitHubAccount account = new GitHubAccount(new Account("m", "t"), 
Full Snippet Info
8
CodeRank
This code example shows how to use the following methods: toString
45:	Account account = new Account("name", "type"); 
46:	assertThat(account.toString()).isEqualTo("Account {name=name, type=type}"); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods:
18:	Account a = new Account("a", "b"); 
-
22:	assertThat(sync.account).isSameAs(a); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods:
97:	Account account = new Account("accountName", "accountType"); 
98:	long groupId = createGroup(account, "sid", "def", 
-
100:	long contactId2 = queryContactId(createRawContactWithName("Helen", "Parr", 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods:
39:	super.setAccount(new android.accounts.Account(account.name, "unknown")); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods:
256:	setAccount(new Account(name, type), false); 
Full Snippet Info
6
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: setIsSyncable, setSyncAutomatically
35:	Account appAccount = new Account(ACCOUNT_NAME,ACCOUNT_TYPE); 
-
38:	ContentResolver.setIsSyncable(appAccount, PROVIDER, 1); 
39:	ContentResolver.setSyncAutomatically(appAccount, PROVIDER, true); 
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:
142:	final Account account2 = new Account("b@example.com", "example.type.2"); 
-
179:	engine.setIsSyncable(account2, 0, authority1, 1); 
180:	engine.setSyncAutomatically(account2, 0, authority1, true); 
-
185:	engine.setIsSyncable(account2, 0, authority2, 0); 
186:	engine.setSyncAutomatically(account2, 0, authority2, true); 
-
207:	syncs = engine.getPeriodicSyncs(account2, 0, authority1); 
-
212:	assertEquals(true, engine.getSyncAutomatically(account2, 0, authority1)); 
-
214:	assertEquals(true, engine.getSyncAutomatically(account2, 0, authority2)); 
-
217:	assertEquals(1, engine.getIsSyncable(account2, 0, authority1)); 
-
219:	assertEquals(0, engine.getIsSyncable(account2, 0, authority2)); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods:
227:	mAccount = new Account(accountName, accountType); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods:
37:	super.setAccount(new android.accounts.Account(account.name, "unknown")); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: requestSync, setIsSyncable, setSyncAutomatically
73:	final Account account = new Account(mAccountName, mAccountType); 
-
80:	ContentResolver.setSyncAutomatically(account, ContactsContract.AUTHORITY, true); 
81:	ContentResolver.setIsSyncable(account, ContactsContract.AUTHORITY, 1); 
-
84:	ContentResolver.requestSync(account, ContactsContract.AUTHORITY, new Bundle()); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods:
39:	super.setAccount(new android.accounts.Account(account.name, "unknown")); 
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: addPeriodicSync
53:	Account account = new Account("Speakbird Twitter Account", "com.lorenzobraghetto.speakbird.account"); 
54:	ContentResolver.addPeriodicSync(account, "com.lorenzobraghetto.speakbird.content", new Bundle(), Long.parseLong(time)*60); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: addPeriodicSync
54:	Account account = new Account("Speakbird Twitter Account", "com.lorenzobraghetto.speakbird.account"); 
55:	ContentResolver.addPeriodicSync(account, "com.lorenzobraghetto.speakbird.contentm", new Bundle(), Long.parseLong(time)*60); 
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: addAccountExplicitly
111:	AccountManager.get(this).addAccountExplicitly( 
112:	new Account(mAcctName, mAcctType), "dummyPassword", null); 
Full Snippet Info
4
CodeRank
This code example shows how to use the following methods: putExtra
23:	setBackupAccount(context, new Account(accountName, accountType)); 
-
27:	context.startService(new Intent(SET_BACKUP_ACCOUNT).putExtra("backupAccount", account)); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: hashCode
88:	return mAccount.hashCode(); 
Full Snippet Info
4
CodeRank
This code example shows how to use the following methods: getAuthToken
89:	AccountManager.get(activity).getAuthToken(account, AUTH_TOKEN_TYPE, null, activity, getAccountManagerCallback(callback, account, activity, activity, activityRequestCode), null); 
-
95:	return new AccountManagerCallback<Bundle>() { 
Full Snippet Info
4
CodeRank
This code example shows how to use the following methods: getAuthToken
89:	AccountManager.get(activity).getAuthToken(account, AUTH_TOKEN_TYPE, null, activity, getAccountManagerCallback(callback, account, activity, activity, activityRequestCode), null); 
-
95:	return new AccountManagerCallback<Bundle>() { 
Full Snippet Info
4
CodeRank
This code example shows how to use the following methods: equals
312:	if (account.equals(mCurrentAccount)) 
Full Snippet Info
3
CodeRank
This code example shows how to use the following methods: setSyncAutomatically
174:	final Account account = new Account(mUsername, Constants.ACCOUNT_TYPE); 
-
178:	ContentResolver.setSyncAutomatically(account, ContactsContract.AUTHORITY, true); 
Full Snippet Info
4
CodeRank
This code example shows how to use the following methods: getAuthToken
69:	Account accountObj = new Account(accountName, ACCOUNT_TYPE_REQUESTED); 
70:	AccountManager.get(_model.getAppController().getChooseLoginActivity()).getAuthToken(accountObj, 
Full Snippet Info
4
CodeRank
This code example shows how to use the following methods: toString
53:	Log.i(TAG, "performSync: " + account.toString()); 
Full Snippet Info
4
CodeRank
This code example shows how to use the following methods: toString
34:	" \nAccount: " + account.toString() + "\nAuthority:" + authority + 
Full Snippet Info
4
CodeRank
This code example shows how to use the following methods: toString
52:	Log.e(TAG, "performSync: " + account.toString()); 
Full Snippet Info
4
CodeRank
Related Android Account Questions & Answers:
See Code Examples for Android Account Methods: