accountmanager

Android: How to get the configured email account address programmatically

社会主义新天地 提交于 2019-12-03 20:51:37
I used the below code to get the configured account name Account[] accounts = AccountManager.get(this).getAccounts(); for (Account account : accounts) { Log.d("Account", "Name " + account.name); } But i need the email id of the configured Microsoft Exchange account as we can change the name of the account (it is not need to be unique). Thanks in Advance krishnan This code work properly public class RegisteredEmailAccounts extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.registered_email_account); final

Custom Account Type with Android AccountManager

落花浮王杯 提交于 2019-12-03 14:08:28
问题 I have an account type "mypackage.account" and a content authority "mypackage". I have a Service that provides an implementation of AbstractAccountAuthenticator , the addAccount method is implemented like this: /** * The user has requested to add a new account to the system. We return an intent that will launch our login * screen if the user has not logged in yet, otherwise our activity will just pass the user's credentials on to * the account manager. */ @Override public Bundle addAccount

Adding account through Account manager

孤者浪人 提交于 2019-12-03 12:55:39
问题 I'm new to android development so sorry if im asking a really obvious question.For my app I want to add a google account automatically using account manager. Do I want to use addAccount or addAccountExplicitly and how do i go about this assuming the account name was "platinum" and the password is "software". 回答1: try this : Permission required : <uses-permission android:name="android.permission.MANAGE_ACCOUNTS"/></uses-permission> <uses-permission android:name="android.permission.ACCOUNT

How do we control an Android sync adapter preference?

爷,独闯天下 提交于 2019-12-03 09:58:57
问题 In an attempt to write a custom Android sync adapter I followed this. I was success at showing an entry (Account settings) in General setting with the following code snippet from above said example. <PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"> <PreferenceCategory android:title="General Settings" /> <PreferenceScreen android:key="account_settings" android:title="Account Settings" android:summary="Sync frequency, notifications, etc."> <intent android:action="fm

SyncAdapter Without an Account

本小妞迷上赌 提交于 2019-12-03 09:47:38
问题 I'm trying to create a SyncAdapter for my Android app to show YouTube videos from one specific channel. The videos are public domain so I don't want the user to login, create an account, authenticate themselves, upload data, or use the contacts database. I simply want the SyncAdapter to periodically update my app's database with the newest video metadata from that channel. I already built a ContentProvider to access my database. I do like the fact that the SyncProvider will handle the ability

Android AccountManager authToken and OAuth

£可爱£侵袭症+ 提交于 2019-12-03 08:40:50
My task is to write IMAP e-mail client for Gmail. So far I know client should authenticate through OAuth (there's also a java library for IMAP auth by Google). But I'd like to set user free from any password typing. Android provides a cool 'native' way to gain authToken for google account services via AccountManager. But I wonder how to use authToken and what is it for? Is it only for GAE authentication? Is there any way to get oauthToken and oauthTokenSecret without browser (via AccountManager)? Have you tried using " oauth2:https://mail.google.com/ " as the "auth token type" ( authTokenType

Can I use AccountManager to let users sign in with their Google account?

六月ゝ 毕业季﹏ 提交于 2019-12-03 07:18:58
问题 I'm creating an app that will need users to create an account. (Like Facebook or Twitter would require you to.) BUT, since it's an Android app, should/can I let them sign in with their Google Account using AccountManager or some other service? It'd be very helpful if they could just sign in to their Google account and their settings and other options would be saved to that account. Main questions summed up: Is it possible to let a user just use their Google account in my app? If so, do I use

How do I implement an Account on Android without a SyncAdapter

让人想犯罪 __ 提交于 2019-12-03 06:17:39
问题 I am implementing a login system for an Android application utilizing the built-in accounts system (with the AccountManager APIs). All is well and good on Android 2.2+, but on Android 2.1 not including a SyncAdapter causes reboots in the account settings screen (see http://code.google.com/p/android/issues/detail?id=5009 and AccountManager without a SyncAdapter?) To get around this I implemented a stub SyncAdapter, which just returns null from IBinder onBind(Intent intent) , and added the

How to make AccountManager (authtoken) and OpenID work together (without AppEngine)?

浪子不回头ぞ 提交于 2019-12-03 05:56:58
问题 I am making an Android app which should be able to get data from a web service (which is not part of GAE). Users are able to log in to web service through their browser by using OpenId (only Google accounts are allowed). AccountManager can give me authtoken. I could save this authtoken on my server, together with user's google account name (email) and then use this account name to connect his openid login with app registration. But this does not solve anything because I have no way to verify

Custom Account Type with Android AccountManager

北城余情 提交于 2019-12-03 05:09:54
I have an account type "mypackage.account" and a content authority "mypackage". I have a Service that provides an implementation of AbstractAccountAuthenticator , the addAccount method is implemented like this: /** * The user has requested to add a new account to the system. We return an intent that will launch our login * screen if the user has not logged in yet, otherwise our activity will just pass the user's credentials on to * the account manager. */ @Override public Bundle addAccount(AccountAuthenticatorResponse response, String account_type, String auth_token_type, String[] required