accountmanager

AccountManager blockingGetAuthToken gets stuck

痞子三分冷 提交于 2019-12-12 20:15:40
问题 I've been using the SampleSyncAdapter as a base to create my own SyncAdapter. It seems to work well to add a new account, but once I want to get the authtoken with AccountManager.blockingGetAuthToken(... it gets stuck and then throws an OperarationCanceledException after a few minutes. Does anyone have an Idea of what could be wrong here? The code is almost the same as the sample except I am authenticating towards my own server. 05-24 23:00:23.258: ERROR/SyncAdapter(4961):

AccountManager return empty accounts

半腔热情 提交于 2019-12-12 11:21:04
问题 I have an app which is implementing my own Authenticator as described in this article. And it works fine as intended. Now I need to get google account from AccountManager and I am doing it this way: Account[] accounts = AccountManager.get(this).getAccountsByType("com.google"); The problem is that it return an empty array. But when I am using this snippet in my test app without all Authenticator stuff it works like a charm. I can't see where is an actual difference between these cases. Has

Remove a skype account via AccountManager.removeAccount() in Android

此生再无相见时 提交于 2019-12-12 03:14:16
问题 I'm trying to play a bit with Accounts via AccountManager on my Android Phone and would like to write an app to remove some accounts. My code works on facebook accounts but fails on skype account . Any clues on how to remove these kind of accounts (except of course opening the xml and remove the desired line) result=accountManager.removeAccount(Account, null, null); remove_result=result.getResult(); //-> true for a facebook account , false for a skype account . 回答1: You might be forbidden

Retrieve the Auth Token in GDK

无人久伴 提交于 2019-12-12 02:49:55
问题 Retrieve the Auth Token in GDK After Inserting the Mirror Account Successfully Now getting the Auth Token in APK side (GDK side). Mainfest.xml <uses-permission android:name="android.permission.GET_ACCOUNTS" /> <uses-permission android:name="android.permission.USE_CREDENTIALS" /> Activity Code : AccountManager accountManager = AccountManager.get(this); // Use your Glassware's account type. Account[] accounts = accountManager.getAccountsByType(ACCOUNT_TYPE);//Same Account_type which was passed

Why do I get null from retrieving the user's gmail?

寵の児 提交于 2019-12-12 01:07:21
问题 With the following code that retrieves the user's Google account, gmail, I was wondering why I get null from devices like mine (that of course runs on my gmail), whereas it works on my mom's devices: public class MainActivity extends AppCompatActivity { final String TAG = "Sample2"; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); String test = getEmail(getApplicationContext()); Log.d(TAG, "Email is: " +

Unable to send gmail e-mail using Javamail and Account Manager (Error 400)

霸气de小男生 提交于 2019-12-11 18:13:47
问题 I am using Android's Account Manager to authenticate my way into Gmail so I can send an e-mail from the device. During the send process, it appears (from the logs) that everything connects and authenticates okay, but it gives me the following error: E/SMTP TRANSPORT ERROR﹕ 334 eyJzdGF0dXMiOiI0MDAiLCJzY2hlbWVzIjoiQmVhcmVyIiwic2NvcGUiOiJodHRwczovL21haWwuZ29vZ2xlLmNvbS8ifQ== class javax.mail.MessagingException Which when decoded reads: {"status":"400","schemes":"Bearer","scope":"https://mail

No contacts for my AccountManager account

僤鯓⒐⒋嵵緔 提交于 2019-12-11 13:23:58
问题 I am currently working on a project in which I want to access the mobile contacts, So I have managed to create account with accountmanager and also able to perform Syncadapter operation. I could see my account got created in the mobile settings->Accounts . However, when I try to get all the contacts with my account with below code ,it does not work. Its showing all apps(google.com and WhatsApp.com) contacts except my app account contacts. Cursor cursor = getContext().getContentResolver()

Trac Single Signon not working as mentioned in the cookbook

时间秒杀一切 提交于 2019-12-11 12:18:08
问题 I am using Trac 0.12.3 in a multi project setup with subversion and am using AccountManagerPlugin from the trunk. The default index page enlists all the project directories and clicking on any of them takes me to the trac page for that project. When I try to login, I am successfully authenticated, however, coming to another project needs me to log in again. I wanted to use single sign on and followed the steps mentioned at http://trac-hacks.org/wiki/CookBook/AccountManagerPluginConfiguration

gData: get account(self contact) first and last name

主宰稳场 提交于 2019-12-11 08:24:51
问题 I want to get first and last name of a google account using gdata library. I have the auth token(I take it from android device - send it to my java servlet- then should add an insert into a mysql db with first, last, display name and provider_uid(provider_uid is the form of https://www.google.com/accounts/o8/id?id=AItOawmyn...)). I used Contacts feed like this(without success): public String tryGoogleAuthentication(String auth_token){ ContactsService contactsService = new ContactsService("...

Unauthorize and App from AccountManager Credential Access

随声附和 提交于 2019-12-11 04:36:02
问题 I have an app that I'm developing that uses AccountManager to get credentials for a Google account that is subsequently used for getting a cookie from AppEngine. I've noticed that I find bugs when I send the app to testers because they get prompted to authorize the account. I need to do a bunch of testing and am looking for a way to "unauthorize" an app from a particular credential so I can do my testing on the next install. I can't find anything in settings where I can remove the