accountmanager

Is this possible to add and configure an exchange account programmaticaly

房东的猫 提交于 2019-12-08 07:37:33
问题 On android we can add an account manually through settings->Account&sync->add account->Corporate and then we fill the fields and add the account. I want to do this programmatically. I searched on internet but did not find any way to do this. I found two posts ( http://code.google.com/p/android/issues/detail?id=21233 AND Android How to add/configure Exchange setting programmatically? ), after which it looks like that it is not possible...But does any one know any way to do this? We can

AccountManager and signature check

只愿长相守 提交于 2019-12-08 03:05:49
问题 Security tips chapter related to AccountManager mentions that: If credentials are used only by applications that you create, you can verify the application that accesses the AccountManager using checkSignature(). Where in the code should I check the signature? I've already tried to use Binder.getCallingUid( ) to obtain the UID of the calling process inside my own implementation of the AbstractAccountAuthenticator , but it returns 1000 as the system process performs IPC. I need to obtain UID

How to get the First Gmail account detail when we switch ON our phone and register it

和自甴很熟 提交于 2019-12-07 18:40:12
问题 I have the following code that is getting all the gmail id's that are synchronized with my phone but i want the Main gmail id that user register the first time. Because all the other gmail accounts(not main) if i want i can delete anytime but to delete the main account we have to done other things too, So that's why i want to get the main account to use into my application. here's my code i think to add some filter in it, i can do that but can't able to get the thing correctly. Account[]

Using Android AccountManager for 3rd party OAuth2 authorization

雨燕双飞 提交于 2019-12-07 06:19:53
问题 I am working on an app that will need to get authorization via OAuth2 from a 3rd party web service (3rd party meaning it's not Google and I don't own it). This article: http://developer.android.com/training/id-auth/authenticate.html seems to suggest that I should be using AccountManager for this purpose. After giving this some thought, I have some doubts about the benefit of doing this, or even if it's appropriate for me to do this. If I wanted to use a Google account, or some other account

How can I access the Google account user_id?

狂风中的少年 提交于 2019-12-07 00:12:42
I'd like to access the user's Google account user_id for authentication , but I don't see any mention of this in the AccountManager . How can my app request the user_id ? Jason Hall Now that Google Play Services is available, you can use it to request the user's permission to access the https://www.googleapis.com/auth/userinfo.profile scope and, with the resulting access token, make a request to https://www.googleapis.com/oauth2/v1/userinfo?access_token={accessToken} to get their user ID. Chirag Shah You will need to use the Android AccountManager's getAuthToken API until Google Play services

How to get the First Gmail account detail when we switch ON our phone and register it

余生长醉 提交于 2019-12-06 12:00:06
I have the following code that is getting all the gmail id's that are synchronized with my phone but i want the Main gmail id that user register the first time. Because all the other gmail accounts(not main) if i want i can delete anytime but to delete the main account we have to done other things too, So that's why i want to get the main account to use into my application. here's my code i think to add some filter in it, i can do that but can't able to get the thing correctly. Account[] accounts=AccountManager.get(this).getAccountsByType("com.google"); for(Account account: accounts) { String

Google Account Authenticator asks for permission at run-time

女生的网名这么多〃 提交于 2019-12-06 08:19:22
问题 I use AccountManager.getAuthToken from my service to have access to Googledocs and Spreadsheet API. As I'm doing it from background and don't want to interrupt user , I allow accountManager to raise notification when user interaction needed (using parameter boolean notifyAuthFailure). As I expected, CallBack is called with AccounManagerFuture,which resolves to Bundle with KEY_INTENT field in such case. "In that case, you may need to wait until the user responds, which could take hours or days

get Primary Email Account of android phone

半城伤御伤魂 提交于 2019-12-05 14:31:36
问题 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

Using Android AccountManager for 3rd party OAuth2 authorization

跟風遠走 提交于 2019-12-05 11:42:18
I am working on an app that will need to get authorization via OAuth2 from a 3rd party web service (3rd party meaning it's not Google and I don't own it). This article: http://developer.android.com/training/id-auth/authenticate.html seems to suggest that I should be using AccountManager for this purpose. After giving this some thought, I have some doubts about the benefit of doing this, or even if it's appropriate for me to do this. If I wanted to use a Google account, or some other account that was already installed into AccountManager by some other app, then obviously it would be a good idea

Store additional data in Android Account Manager

◇◆丶佛笑我妖孽 提交于 2019-12-04 23:36:15
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 password and an account. What is the best practice for storing the third piece of information? As pablisco explained, you can use AccountManager's ability to store arbitrary user data through addAccountExplicitly() 's userData Bundle parameter: final Bundle extraData = new Bundle(); extraData.putString("someKey", "stringData"); boolean accountCreated