Questions tagged [accountmanager]

AccountManager keeps track of cloud login information on Android devices. It uses plugins to communicate with different kinds of services, and the user only has to enter the information once. Applications don't need to deal with passwords, and may instead ask for permission to gain access to specific accounts.

As a part of Google's Android SDK, the AccountManager can be used create a separation of the cloud account information entered by the user and the applications that make use of it. Since web services are constructed differently from each other, AccountManager uses plugins (authenticators) in order to communicate with them.

An application can ask for permission to access a certain account. If successful, the application receives a token, and never has to deal with the actual password. The user can find a list of all accounts that are used on the device under Settings > Accounts & sync, and may at any time remove an account that shouldn't be accessed anymore.

519 questions
169
votes
4 answers

What should I use Android AccountManager for?

I've seen AccountManager in the Android SDK and that it is used for storing account information. Thus, I cannot find any general discussion of what it is intended for. Does anyone know of any helpful discussions of what the intention behind…
Phil
  • 4,377
  • 3
  • 21
  • 10
62
votes
4 answers

Shouldn't Android AccountManager Store OAuth Tokens on a Per-App/UID Basis?

Android's AccountManager appears to fetch the same cached auth token for apps with different UIDs - is this secure? It does not seem compatible with OAuth2, since access tokens are not supposed to be shared between different…
46
votes
3 answers

Android Login - Account Authenticator vs Manual Authentication

I'm about to implement login along with user authentication in my app. My first idea was to do it manually, register username and password with the server, get auth token, save it and use it in subsequent requests. After googling around, I gathered…
Daniel Julio
  • 1,463
  • 3
  • 14
  • 23
37
votes
2 answers

AuthToken from AccountManager in Android Client No Longer Working

I'm pretty exasperated. I'm attempting to build a turn-based multiplayer online game for Android using Google App Engine in Java as the server. They seem like a perfect fit. Android requires a Google account, and GAE uses a Google account for…
polyclef
  • 1,281
  • 2
  • 16
  • 20
34
votes
1 answer

Create Email account from type existing Account Services

I have gone through SampleSyncAdapter sample project provided by Android doc, but as I understand, there we need to add an account of custom Account service. But my need is to create an email account from existing account services on device. To be…
Android Learner
  • 2,559
  • 6
  • 34
  • 43
31
votes
4 answers

Webservice credentials - OpenID/Android AccountManager?

I'm building a webservice and would like to use the user's google account credentials. The service runs on GAE and will have a web client and an Android native client. This is my first attempt of something like this and I've been reading about…
Tomer Weller
  • 2,812
  • 3
  • 26
  • 26
28
votes
1 answer

A good tutorial for using AccountManager in Android?

Does anyone know of any good tutorials for using AccountManager in android, basically what I'm trying to do is request a OAuth2 token to use with a google api, any suggestions would be appreciated :)
William L.
  • 3,846
  • 9
  • 53
  • 72
22
votes
2 answers

How do I retrieve the logged in Google account on android phones?

I am developing an Android application and I need to retrieve the Google account used on the phone. I want to do this for the C2DM, but I don't want to ask the user to enter in his/her Google email account if they are already logged in. Is there any…
fanar
  • 611
  • 3
  • 7
  • 15
20
votes
2 answers

How to call parent activity function from ASyncTask?

setAccountAuthenticatorResult can be called from the Activity, which extends AccountAuthenticatorActivity. My activity extends that, but launches ASyncTask and hence this setAccountAuthenticatorResult should be called from ASyncTask (or, the result…
LA_
  • 19,823
  • 58
  • 172
  • 308
20
votes
2 answers

Should you use AccountManager for storing Usernames and Passwords for an Android app?

I would like to know if one should implement AccountManager to save user credentials such as username, email, passwords etc. I can't find a good reason to use it myself. I don't want other applications to have access to the Accounts and I don't…
HGPB
  • 4,346
  • 8
  • 50
  • 86
19
votes
2 answers

Custom Account authenticator. Cleanup after account is removed from device

Is there a way to get some kind of notification/broadcast/etc. when a custom account is removed from "Accounts & sync settings"? The application I have can facilitate multiple users on a device (this is for a corporate use) and uses a single SQLite…
Audrius
  • 2,836
  • 1
  • 26
  • 35
18
votes
4 answers

Android: AccountManager.getAccounts() returns an empty array

I'm writing an app targeted at Lollipop and above. This is my first Android app. I'm trying to get a list of all the accounts that are associated with the device. Here is my code: public void getAllContactsAccounts(Context context){ …
craigmiller160
  • 5,751
  • 9
  • 41
  • 75
16
votes
2 answers

Store additional data in Android Account Manager

I'd like to use the android AccountManager to sync my webservice and application (standard sync of contacts and calander) however, AccountManager only appears to store a username and password. My web service takes three credentials: a username, a…
Jon Wells
  • 4,191
  • 9
  • 40
  • 69
15
votes
2 answers

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

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…
Andrew Wyld
  • 7,133
  • 7
  • 54
  • 96
15
votes
4 answers

How do you force AccountManager to show the "Access Request" screen after a user has already allowed access?

When using AccountManager::getAuthTokenByFeatures, an Access Request screen is shown for the user to allow or deny access to the account. After a user allows access, subsequent calls (with the same arguments) return the auth token without prompting…
Russell Davis
  • 8,319
  • 4
  • 40
  • 41
1
2 3
34 35