accountmanager

How to make a custom account show up like Google/LinkedIn/Facebook in the native Contacts app?

元气小坏坏 提交于 2019-12-04 14:36:44
问题 I'm currently working on an application, where we are going to be adding contacts from our own application, similar to how LinkedIn has connections and Facebook has friends. Therefore we want our custom account, that is shown in the images below (as " MyAppName ") with the contacts added from our application: We currently have a SyncAdapter as seen from the first image, as just wish for this to be shown in the Contacts application. We've been looking at documentation, but couldn't find

Using Android AccountManager to get authtoken for gdata

*爱你&永不变心* 提交于 2019-12-04 13:49:19
问题 So I am trying to sync to google docs, without having to ask the user for his credentials. I use this code to get an auth-token: AccountManager mgr = AccountManager.get(activity); authToken = mgr.blockingGetAuthToken(account, DocsService.DOCS_SERVICE, true); This returns a auth-token that looks well-formated. So on my DocsService I run: service.setAuthSubToken(authToken); However, when I try to use the API I just get a AuthenticationException. Any ideas on how to approach this error? edit: I

Obtaining a basic google auth-token from AccountManager

心已入冬 提交于 2019-12-04 09:13:08
I want to obtain a Google Authtoken from the AccountManager that I can send to my Webservice (not hosted on App Engine) to authenticate the User (I just need the email address and eventually his name, if no permission is required for this). What do I have to use for the "authTokenType" Paramter of the "getAuthToken" method? And which google Api do I have to use to get the Users Email? This is doable using OpenID Connect, however it's sort of experimental, so details could change in the future. If you get an OAuth token for the 'https://www.googleapis.com/auth/userinfo.email' or 'https://www

Where is the Android Authorization Token Type alias list for Google APIs?

我怕爱的太早我们不能终老 提交于 2019-12-04 08:32:10
问题 While following this tutorial on using OAuth 2 with the Android AccountManager, I'm told that when specifying the AUTH_TOKEN_TYPE, instead of specifying the scope like this: String AUTH_TOKEN_TYPE = "oauth2:https://www.googleapis.com/auth/tasks"; you can use its alias: String AUTH_TOKEN_TYPE = "Manage your tasks"; This allows for a user to understand what the permissions are about instead of being given a URL. I am trying to figure out what the alias would be for the Google Documents List API

Twitter Authentication through Android's AccountManager classes

為{幸葍}努か 提交于 2019-12-04 03:09:03
问题 I am developing an android application and want to integrate Twitter. What I understand is if on user's device, official android Twitter app is installed then we can authenticate using account manager as mentined here.. and if not installed then show twitter login web page. Is my understanding correct? Now authenticating using twitter web login page is working fine. But how do I login using account manager? Using AccountsType as "com.twitter.android.auth.login" I got token and token secret

How to get an icon associated with specific Account from AccountManager.getAccounts()

亡梦爱人 提交于 2019-12-04 02:58:54
There is an icon displayed in account settings for each account. For Google account there is one icon, for Facebook another. Is there a way of getting this icon from the code in application? Finally, I solved it: private Drawable getIconForAccount(Account account, AccountManager manager) { AuthenticatorDescription[] descriptions = manager.getAuthenticatorTypes(); PackageManager pm = getContext().getPackageManager(); for (AuthenticatorDescription description: descriptions) { if (description.type.equals(account.type)) { return pm.getDrawable(description.packageName, description.iconId, null); }

How to add google account in android through AccountManager.addaccountExternally()?

◇◆丶佛笑我妖孽 提交于 2019-12-04 02:49:03
问题 I want to add a google account Explicitly. I will provide username and Password. I just Gone through this Question caller uid XXXX is different than the authenticator's uid But i didnt get solution. What is uid? to which uid it comparing. I am trying AccountManager mgr = (AccountManager)getSystemService(ACCOUNT_SERVICE); Account acc = new Account("xxxj@gmail.com", "com.google"); if(mgr.addAccountExplicitly(acc, "Password", new Bundle())) { //account added successfully //do whatever is needed;

Get the Google ID used to download the application

一曲冷凌霜 提交于 2019-12-04 02:17:20
How can i find out which google account downloaded the application? This question is related to Get the Google ID used in an in-app billing purchase Thank you! Warpzit I think the best answer can be found here: How to get the Android device's primary e-mail address This might not be exacly what you want, but without asking the user, I think this is the closest you can get. 来源: https://stackoverflow.com/questions/10245250/get-the-google-id-used-to-download-the-application

Asynchronous account authentication with Volley

隐身守侯 提交于 2019-12-04 01:28:03
问题 everybody. I'm implementing an account authenticator using AbstractAccountAuthenticator and I need call an asynchronous method in the function getAuthToken, to authenticate a user. My code is like this: public class AccountAuthenticator extends AbstractAccountAuthenticator { ... @Override public Bundle getAuthToken( final AccountAuthenticatorResponse response, Account account, String authTokenType, Bundle options ) throws NetworkErrorException { final AccountManager accountManager =

get Primary Email Account of android phone

谁说胖子不能爱 提交于 2019-12-04 00:26:24
I am working on a project, and I have to fill the EditText automatically with the user's primary email, I am considering primary email as the email that associated with google play store. I have read this post and implemented that, if we are using the AccountManager class for geting the email ids, we will get all the email id added in that phone, so that is not possible, and some says to take the first email id that returned by the AccountManager, but that returns the email id that added in the phone for the first time. ie, suppose I have added test@gmail.com and linked that with google play,