Questions tagged [android-account]

Android Account refers to the object public class Account as part of the mobile operating system Android that acts as a Value type that represents an Account in the AccountManager public class. Use this tag for questions related to this public class.

Android Account refers to the object public class Account as part of the mobile operating system Android that acts as a Value type that represents an Account in the AccountManager public class. Use this tag for questions related to this public class.

Documentation: https://developer.android.com/reference/android/accounts/package-summary

106 questions
8
votes
1 answer

How do I get my custom account type to show up in the android contacts app?

I've created a custom account type and I can successfully create contacts of that type in the android ContactsContract ContentProvider. But I'm having a lot of trouble figuring out how to get my custom account label and icon to show up when editing…
8
votes
1 answer

Using SyncAdapter without creating an account

My app allows people to use and manage their data regardless they're logged in. Though, as I uniquely identify each device, I want to sync data from my anonymous users (not logged ones) as well. So, I was wondering if it is a good practice to create…
Flávio Faria
  • 6,575
  • 3
  • 39
  • 59
8
votes
1 answer

create custom account Android

What is the simplest way to create a custom account on Android? So far I've read the documentation: Creating a Custom Account Type, but it certainly didn't help a lot (too vague info). I tried reading the example from LastFm but certainly they did…
Raykud
  • 2,488
  • 3
  • 21
  • 41
7
votes
3 answers

Android M 6.0 - SecurityException Trying to remove accounts

I have an app that uses Android AccountManager (package name: com.mycompany.accounts), that adds accounts to the device and provides a login screen. I have another app (com.mycomp.actualapp), that uses the first app to add/remove accounts. I can…
7
votes
2 answers

Cannot get AuthToken for custom account from different app

I have two apps that work with a same account type. I want below page to be shown when the user opens the second app for first time and one account exists: But nothing happens when I run this code: final AccountManagerFuture future =…
6
votes
1 answer

How to add whatsapp like options to contact whenever the is a new contact added to Contacts

I develop an app which needs to do 2 things: Create a user account (like WhatsApp). Whenever there is a new contact entry, if the contact is using my app, then immediately in the Contacts application show options "call" or "message" in the contact…
6
votes
2 answers

Getting the Gmail Id of the User In Android

I don't know it is the correct question or not.How can we get the lo-gin id of the user from which it has been lo-gin to the Google Play Store in Android.Is this possible or not.
user2568702
6
votes
2 answers

Programmatically starting the 'Add Google Account' activity in Android

I am developing an application which needs a Google account for certain options. Options are disabled when no account is detected, but I am presenting the user to add one by asking via a popup, if user clicks yes, the activity should start. It's…
slinden77
  • 3,378
  • 2
  • 37
  • 35
5
votes
2 answers

AccountManager: when to set result?

Context My app only stores user/pass. No tokens are used. Question 1 Methods setAccountAuthenticatorResult(Bundle) and onResult(Bundle) are meant to notify the AbstractAccountAuthenticator about the outcome, but I have a project working without…
5
votes
2 answers

Check if a device google account is authenticated, only then allow access to my offline app

I have a private app which works totally offline (i.e. no server data sent/recieved), however I have a need to restrict it only to users with a valid Google account on their phone. I can get make sure there is a suitable account on the phone by…
sham
  • 1,346
  • 1
  • 20
  • 28
5
votes
2 answers

Activity started without an EXTRA_ACCOUNT when using native sharing on GooglePlus SDK

I have a Google+ connection in my app, and when I try to get the user's information with a Person Object, everything works just fine. but when I'm using the Share dialog as stated in the documentation, I get a crash in the G+ library. here is the…
thepoosh
  • 12,497
  • 15
  • 73
  • 132
5
votes
0 answers

Customize dialog while removing account from accountmanager android

I would like to prevent user from removing the account from the Android accounts for my app. Android AbstractAccountAuthenticator provides a method getAccountRemovalAllowed which I can use to prevent from removing account. So far so good. But when I…
Gautham
  • 3,418
  • 3
  • 30
  • 41
5
votes
1 answer

Deleting the database when an Account is removed

My app uses the SyncAdapter pattern, holding user credentials using the AccountManager and a ContentProvider to store data in a db. When the account gets removed I can remove the db using the approach explained in this question. The db gets removed…
Macarse
  • 91,829
  • 44
  • 175
  • 230
4
votes
4 answers

Android - What to use in place of AccountPicker.newChooseAccountIntent because its deprecated

I am working on a project where I have to show the account chooser so that a user can select an email account which is stored in his device. Problem is I have got AccountPicker.newChooseAccountIntent which is deprecated. Is there any alternate way…
Pankaj
  • 7,908
  • 6
  • 42
  • 65
4
votes
3 answers

Android AccountManager.getUserData() returns null

I have a similar problem like this AccountManager getUserData returning null despite it being set But the solutions did not work for me My Authenticator.java public class Authenticator extends AbstractAccountAuthenticator{ private Context…
user2493476