accountmanager

Get the Google ID used in an in-app billing purchase

徘徊边缘 提交于 2019-11-30 00:28:54
It has come to my attention that a device may have multiple Google accounts logged into it simultaneously. I understand that pre-Honeycomb, there is a primary ID; from Honeycomb on you can simply plug in several. I currently have two IDs logged into my test tablet. When purchasing from Google Play you can choose which account is used to make a purchase. I want to add in-app billing to an application I'm writing, and I want to make sure each Google ID gets its purchases on any device, which means I need to know which ID was used to make the purchase in the first place. This means I need to do

Android SyncAdapter Automatically Initialize Syncing

痴心易碎 提交于 2019-11-29 21:53:56
I have a SyncAdapter for my app, and an AccountManager to add my apps accounts to the Android Account Manager. My code for when I add an account to the Account Manager looks like: Bundle data = new Bundle(5); data.putString(_PEOPLE_ID, people_id); data.putString(_FIRST_NAME, first_name); data.putString(_LAST_NAME, last_name); data.putString(_PLAN, plan); data.putString(_BIRTHDAY, birthday); Account account = new Account(username, _ACCOUNT_TYPE); try { boolean created; created = _account_manager.addAccountExplicitly(account, _cryptography.encrypt(_SEED, password), data); response.accountCreated

Why is AccountAuthenticator#getAuthToken() not called?

穿精又带淫゛_ 提交于 2019-11-29 12:33:39
问题 I created my own Android account authenticator by extending AbstractAccountAuthenticator and implementing addAccount() and getAuthToken(). Some of the methods in it are called by AccountManager, but others are not. This works great: AccountManager#addAccount() AccountManager accountManager = AccountManager.get(activity); accountManager.addAccount(MyAccountAuthenticator.ACCOUNT_TYPE, MyAccountAuthenticator.AUTHTOKEN_TYPE_FULL_ACCESS, null, null, activity, callback, null); The problem happens

AccountManager without a SyncAdapter?

旧城冷巷雨未停 提交于 2019-11-29 06:51:00
I'm trying to use AccountManager to store account information and have implemented an authenticator, but I keep getting exceptions like the below that crash the phone. Comparing with sample code this seems to be because I don't have (or particularly want) a SyncAdapter and associated service. Is there a trick to using AccountManager without adding a SyncAdapter? Regards Phil I/AuthenticatorActivity( 8526): onAuthenticationResult(true) I/AuthenticatorActivity( 8526): finishLogin() W/dalvikvm( 8108): threadid=13: thread exiting with uncaught exception (group=0x 4001b170) E/AndroidRuntime( 8108):

Like video with access token on YouTube using YouTube Data API v3?

寵の児 提交于 2019-11-29 05:22:22
I want to like video of YouTube. I have acquired AUTH_TOKEN using AccountManager using the following am.getAuthToken(mAccount, AUTH_TOKEN_TYPE, null, this, new AccountManagerCallback<Bundle>() { public void run(AccountManagerFuture<Bundle> future) { try { if(future != null && future.getResult() != null) { if(future.getResult().containsKey(AccountManager.KEY_AUTHTOKEN)) { AUTH_TOKEN = future.getResult().getString(AccountManager.KEY_AUTHTOKEN); } } } catch(OperationCanceledException e) { } catch(AuthenticatorException e) { } catch(IOException e) { } catch(Exception e) { } } }, null); Now i want

Does SyncAdapter get notified when AccountManager removes account?

孤者浪人 提交于 2019-11-29 03:47:44
问题 So, my question restated is when you go to Settings -> Accounts & Sync and select the an account that was created that your SyncAdapter is syncing with a cloud server, and select remove account, what happens as far as your SyncAdapter is concerned? There is a dialog that displays asking you to confirm and that the data on the phone associated with that account will be removed. I cannot easily believe that the framework can automatically remove the data my SyncAdapter has stored in the local

Add account automatically

…衆ロ難τιáo~ 提交于 2019-11-29 02:39:05
My application needs to synchronize some data from server. I added necessary classes (similarly to SampleSyncAdapter) now I can add account via "Settings/Sync and Accounts". But I want to have already added my account and working synchronization just after application is installed (I do not want user to do any manual changes in settings). How to do this? There is Android AtLeap library which contains helper classes to use Account Authenticator. Have a look at it https://github.com/blandware/android-atleap A bit late but... Account account = new Account("Title", "com.package.nom"); String

Access youtube account with accountmanager

淺唱寂寞╮ 提交于 2019-11-28 22:11:14
Im trying to access youtube account with account manager, meaning i want to access youtube with a account linked to my device and with this get youtube token to access user playlist and whatever. Freedi application for android doing somthing like this. I used this code to get token am.getAuthToken(accounts[0], "youtube", true, new AccountManagerCallback<Bundle>() { @Override public void run(AccountManagerFuture<Bundle> future) { try { Bundle bundle = future.getResult(); if (bundle.containsKey(AccountManager.KEY_INTENT)) { Intent intent = bundle.getParcelable(AccountManager.KEY_INTENT); intent

Get the Google ID used in an in-app billing purchase

試著忘記壹切 提交于 2019-11-28 21:23:59
问题 It has come to my attention that a device may have multiple Google accounts logged into it simultaneously. I understand that pre-Honeycomb, there is a primary ID; from Honeycomb on you can simply plug in several. I currently have two IDs logged into my test tablet. When purchasing from Google Play you can choose which account is used to make a purchase. I want to add in-app billing to an application I'm writing, and I want to make sure each Google ID gets its purchases on any device, which

Android SyncAdapter Automatically Initialize Syncing

本秂侑毒 提交于 2019-11-28 17:48:54
问题 I have a SyncAdapter for my app, and an AccountManager to add my apps accounts to the Android Account Manager. My code for when I add an account to the Account Manager looks like: Bundle data = new Bundle(5); data.putString(_PEOPLE_ID, people_id); data.putString(_FIRST_NAME, first_name); data.putString(_LAST_NAME, last_name); data.putString(_PLAN, plan); data.putString(_BIRTHDAY, birthday); Account account = new Account(username, _ACCOUNT_TYPE); try { boolean created; created = _account