Where is AccountManager in Amazon Kindle HDX? - android

I have implemented the AccountManager workflow to add accounts to my service in the standard Android settings screen.
In typical Android devices, I successfully get my App's icon, settings, login workflow, etc. in the "Accounts" section of the settings screen, and I am able to add accounts.
However, in an Amazon Kindle HDX, even though the API exists, and in my App details I can see the permissions are identified (android.permission.AUTHENTICATE_ACCOUNTS, ...), I can't find the AccountManager anywhere in the settings screen. Everything seems related to Amazon authentication. The closest thing is "Social Network Accounts" under "My Account", but only displays Facebook and Twitter, and seems a proprietary account manager rather than Android's.
Does anybody know if
The standard Account list exists in Kindle HDX?
The AccountManager API is the way to go? or shall I write a custom account dialog in case the App is running on a Kindle?
Regarding the second question, Amazon claims the API is supported https://forums.developer.amazon.com/forums/thread.jspa?threadID=906 but if accounts can't be listed or managed, I suppose it's better to use a proprietary approach. Am I wrong?

Related

Avoiding Google Drive Java REST API prompting for user account everytime on devices with multiple accounts

I have a working solution where I search for files in Google Drive and ask for Google Drive to open them using the getWebViewLink, this generates a link like this:
https://drive.google.com/file/d/0B6cgfp1Py-7SAF&SAFgASFGZGlQWEU/view?usp=drivesdk
Then I parse the link and generate an intent like this:
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(link));
startActivity(intent);
This works great on devices configured with one gmail account, but if the device happens to have 2 or more gmail accounts configured then Google Drive keeps always asking which account the user wants to use to open the file.
Is there anyway to suggest in the link which account to use to Google Drive?
P.S: I tried adding the following to the link to no avail
&approval_prompt=auto
or
&user_id=myemail#gmail.com
You may refer with this related thread. It stated that the redirect loop happens to users that have both a Gmail account and a Google Apps account. There are only one set of active Docs cookies at any given time. The workarounds are to either log out of the account that you are not currently trying to use for Docs access or use different browsers for each account.
Here's another reference which might help: How can I enforce GoogleApiClient to prompt account chooser UI each time I call connect?
...you must manage the account selection yourself as you can see here (for REST) or here (for GDAA)
Hope this helps!

Where do Smart Lock for Passwords sign-in hints come from and how to customize them?

In Google Play Services v8.3 Google added a way to provide the user with account "hint" for logging in - A UI to select previously used emails to sign up to an app.
See here for more info.
I was wondering where does Google take the emails shown in that screen, testing it on my device I see some really old / unused emails that I probably previously signed in with.
Is there a way to customize it so that only emails that are set up on the device will show up in the hint screen ?
Great question, I'm the product manager for Smart Lock at Google, here are the answers:
Where do the email addresses shown in the "hints" dialog come from?
The items shown at the top of the list correspond to the email addresses for the Google Account(s) on the device, and any other email addresses from the Android Account Manager (e.g. IMAP email addresses, email address registered by Facebook app, etc.)
Other email addresses saved with any of the Google accounts on the device are shown next, sorted by most frequent occurrence. These were either saved to Smart Lock elsewhere (e.g. in other apps) or for websites via the Chrome password manager. These entries should correspond to what's visible at passwords.google.com or chrome://settings/passwords in Chrome for the Google Accounts on the device.
As noted, the "hint" dialog is intended to allow the user to supply an email address (as well as name or photo URL if available) with one tap to the developer's app to help sign in or sign up, allowing pre-filling of fields in sign-in or sign-up forms, or by skipping sign-in UI completely by providing the app an ID token which can be used for backend authentication.
Note that this dialog is displayed by Play Services and its contents cannot be read by the calling app and are private to the user; only information from an entry which is selected by the user is provided to the developer's app. This also means that the dialog text can't be customized, other than switching between Sign in and Sign up, see this question for details.
We've considered adding UI for the user to customize what's shown on the list, but in our UX testing, such a feature is rarely used and added visual complexity and opportunity for error. In practice, most users only have a few entries and since the most the common addresses are at the top, users just pick the one they want and ignore the rest. The other entries don't really cause harm, so we've opted not to make this customizable by the user for now.
That said, can the developer customize what's shown in the dialog?
Yes, developer could modify the HintRequest to .setPhoneNumberIdentifierSupported(true) and .setEmailAddressIdentifierSupported(false), which will cause phone numbers to be shown instead, from similar sources above (from device or associated with Google Account).
Similarly the HintRequest builder can be configured to show a "Sign up with" or "Sign in with" prompt rather than the default "Continue with".
Regarding only showing the email addresses on the device: if the app's authentication system is based on email address, I'd recommend keeping the complete list of email address (not just the ones on the device), since often the user's intended email address is not a Google account (e.g. a work, school, Yahoo/Hotmail, or regional email provider). As noted above, in practice, the presence of other email addresses usually helps and does not detract from task completion (user either sees the email address they are looking for, ignores the rest, or taps "None of the above" to enter something manually), and less-used email addresses work their way to the bottom over time. (experience for developers with lots of test email addresses is a bit different than end users, who typically have a short list of email addresses)
Hope that helps! Please leave a comment with any questions or feedback.
Correct me if I am wrong, but there is no "hint" screen. The link you shared talks about getting credentials from one of the accounts selected from the account screen to pre-fill the sign-up form in the app.
The screen I think you are referring to is the Smart Lock account dialog (that is what I call it at least). This screen lets you select which account saved with Smart Lock you want to use within the current Google account you're using.
The screenshot you shared seems to be another dialog that is asking what Google account you want to use (which can then have multiple Smart Lock accounts aka credentials saved in it). You can tell the difference between the two screen by the title. The Smart Lock account dialog says "Choose a -app name- account saved with Google Smart Lock"
If this screen you show can be customized, then it would not be through Smart Lock, but perhaps a Google sign in API. Sorry I could not be of more help.

ICS Emulator will not create Calendar Account

Please help. I absolutely need to be able to test the Calendar.contract provider in my app using the SDK emulator. Purchasing a $400 hardware device just to test is not a real option.
I have seen the posts that remind us that we need to target the Google API platform, which we have done. Next, I have seen a work around where it is suggested that we create a google account as an exchange account by specifying the m.google.com server and clicking "Accept all SSL". Unfortunately, that generates the error that:
You have typed an incorrect server address or the server requires a protocol version that Email doesn't support.
We created a basic Google account. However, the emulator still says we must create at least one calendar account and forces us into creating the Echange Account. According to the emulator, the account we did create as a Google account has no calendars associated with it, even though I can go to Google Calendar, access that account, and add items to a calendar.
Can anyone suggest a solution?
Thanks,

Android sync adapter with appengine Google user accounts

I am implementing a sync adapter for my app to sync with an appengine backend. On appengine I am using the built in User api for authentication. There is a post HERE that tells how to do it, however the app is listed under the gmail account. Ideally my app would be listed in the accounts. I don't want to ask the user for username and password, just use the existing google account for authentication. Has anyone done this before??
Update:
I've been working on this and it looks like I could implement the AuthenticationService and store the users account name and leave the password as an empty string. In the getAuthToken() methods I should be able to simple return the google auth token. Will post once I get further along...
Perhaps you have misunderstood the Android account system. When you go to Settings -> Accounts & Sync and add a new account what you see then is a list of account types. Often there is a relationship between account types and apps, for example Facebook accounts are used together with Facebook. Normally you would add a new account type if you have a different backend system for handling authentication etc.
If I understand you correctly, you use Google accounts but want it to appear as your own account type. That sounds wrong to me. You'll end up reimplementing the Google account handling, with little value. I believe it is simpler for users if you simply piggyback on what Google provides you with. Your app / service / content provider can be seen when clicking on the account. For example, after installing "Tasks" by "Team Task" (disclaimer: I'm not affiliated with that company) they add "Sync Tasks" to the list of data & sync options.
But if you really want to create your own account type, follow the sample Sample Sync Adapter. Look for the Authenticator code and related resources (e.g., manifest, activity layout, etc.).
This is indeed possible and I have implemented this with success but be warned it is a bit of a headache.
There is an excellent tutorial available called writing-an-android-sync-provider-part-1
... don't forget to check the follow up in part 2
Beyond this there is also an example in the Android SDK samples called SampleSyncAdapter which was invaluable in my development.
With a little hard work and a lot of coffee you should be able to get this working ;)

Android 2.0+ account duplication

I know that you can setup accounts in Android 2.0+ and thats great but as i have recently found out, it can create duplication.
My phone(Sprint HTC hero 2.1-upadate1) comes with HTC Sense and thats great, it also has Peep pre-installed and it asked me when i setup the phone to add a twitter account, and so i did. I can now open peep and it all works, perfect.
But I decided i wanted to try the Twitter for Android app. I installed it and it also asked me to create a twitter account, not good. I did create the new account and the app worked just like it was supposed to.
Then when i go into my accounts i can see that i have two twitter accounts(the same one). Is this something that can be avoided in the programming or is this something that can be fixed with the os?
I also noticed the same for the facebook account. Is there something in the SDK that can prevent this...or combine the accounts after the fact? or is this all completely up to the developers.
If its up to the developers then i would really like to see some code/documentation so i can avoid such things.
Accounts on Android have a notion of account 'types'; see AccountManager for details. For example, Google Accounts are of the type com.google. Peep and the Twitter for Android apps may be using different account types, and may not be using compatible authentication tokens (also see AccountManager and AbstractAccountAuthenticator). More on accounts and authenticators can be found in the SampleSyncAdapter SDK sample code.
The 'right' thing to do in my opinion is for developers to standardize on and document account types for services they're consuming, provide account authenticators for those account types, and then authenticate to said services using tokens obtained via AccountManager. There are also many opportunities to integrate deeper with contacts, sync, etc.

Categories

Resources