accountmanager

In a nutshell what's the difference from using OAuth2 request getAuthToken and getToken

依然范特西╮ 提交于 2019-11-27 13:21:40
When deling with access token OAuth 2.0 In a nutshell what's the difference from using: AccountManager.getAuthToken ("oauth2:https...userinfo.profile") , and using Google Plays: GoogleAuthUtil.getToken(mActivity, mEmail, mScope) As I understand it they both produce a challenge screen for the user, the Google Plays screen is user friendlier. The access token can have same scope right?! Both call have to be asynchronously. InvalidateToken looks like it has to be checked for in both calls, and more? nibarius I didn't know about using Google Play services for OAuth 2.0 authentication, but after

Android Login - Account Authenticator vs Manual Authentication

允我心安 提交于 2019-11-27 09:16:06
问题 I'm about to implement login along with user authentication in my app. My first idea was to do it manually, register username and password with the server, get auth token, save it and use it in subsequent requests. After googling around, I gathered that the correct way to do it on Android was using Account Authenticator. I've seen a few examples of it's implementation but I don't understand the advantage of doing it this way? Is it because I can have more than one account stored? Is it

Display the app icon if the contact is associated with the application in phone address book

扶醉桌前 提交于 2019-11-27 04:51:01
I am trying to display the application icon for the phone number which is associated with the application. I tried to follow this link but it is too difficult. Is there any library for this or any easy way to solve this problem? For example, we can say the contact is present in whatsapp, facebook, google, ... in phone address book. Similarly I want to display my application icon beside these messenger applications. The following code shows a possible solution. Calling the synchronizeContact method will lead to adding the link in the contact app. Note it is not yet robust code but it shows the

Should you use AccountManager for storing Usernames and Passwords for an Android app?

安稳与你 提交于 2019-11-27 01:22:03
问题 I would like to know if one should implement AccountManager to save user credentials such as username, email, passwords etc. I can't find a good reason to use it myself. I don't want other applications to have access to the Accounts and I don't really want them showing in the "Accounts and Sync" settings (although maybe that's not a big deal). So my question is: should I use it? Pros/cons? Can I hide the Accounts from other apps and stop them from appearing in "Accounts and Sync"? 回答1: This

AuthToken from AccountManager in Android Client No Longer Working

偶尔善良 提交于 2019-11-26 23:51:56
问题 I'm pretty exasperated. I'm attempting to build a turn-based multiplayer online game for Android using Google App Engine in Java as the server. They seem like a perfect fit. Android requires a Google account, and GAE uses a Google account for authentication, while being free and scalable. So before the holidays I was able to get authentication to my GAE app from my Android client using the new AccountManager API in Android 2.0. The following code allows you to access the AuthToken of the user

How to get device email address in Delphi 10

女生的网名这么多〃 提交于 2019-11-26 23:26:25
问题 I'm trying to get my device email address, I used Java2OP to convert AccountManager class to object pascal. However, I tried to get the email address using the following code: jAm: JAccountManager; accounts: TJavaObjectArray<JAccountClass>; jAcc: JAccountClass; begin jAM := TJAccountManager.JavaClass.get(SharedActivityContext); accounts := TJavaObjectArray<JAccountClass>.Wrap(jAM.getAccountsByType(StringToJString('com.google'))); mmLog.Lines.Add('Length Accounts: ' + Inttostr(accounts.Length)

Webservice credentials - OpenID/Android AccountManager?

隐身守侯 提交于 2019-11-26 21:39:52
I'm building a webservice and would like to use the user's google account credentials. The service runs on GAE and will have a web client and an Android native client. This is my first attempt of something like this and I've been reading about OpenID and the Android AccountManager library. I'm still not sure what are my options in terms of storing the users in my Datastore. What Identifier should I use ? Is it possible to use OpenID on a native Android application ? Any help and/or pointers would be appreciated. Thanks. We had a similar requirements on the last project: GAE backend with GWT

How to call parent activity function from ASyncTask?

懵懂的女人 提交于 2019-11-26 20:24:06
问题 setAccountAuthenticatorResult can be called from the Activity, which extends AccountAuthenticatorActivity . My activity extends that, but launches ASyncTask and hence this setAccountAuthenticatorResult should be called from ASyncTask (or, the result of ASyncTask should be passed back to the main thread). How to do it? What is wrong in the code below? AsyncTask<Uri, Void, Bundle> task = new RetrieveAccessTokenTask(this, consumer, provider, prefs).execute(uri); public class

How do you force AccountManager to show the “Access Request” screen after a user has already allowed access?

假如想象 提交于 2019-11-26 18:18:48
问题 When using AccountManager::getAuthTokenByFeatures, an Access Request screen is shown for the user to allow or deny access to the account. After a user allows access, subsequent calls (with the same arguments) return the auth token without prompting the user. How do you clear the state to make sure the Access Request prompt appears? (This would useful at the very least for development, testing, and demo purposes.) 回答1: The only solution I've found is to manually clear out the data stored in

How do I retrieve the logged in Google account on android phones?

别说谁变了你拦得住时间么 提交于 2019-11-26 17:32:20
I am developing an Android application and I need to retrieve the Google account used on the phone. I want to do this for the C2DM, but I don't want to ask the user to enter in his/her Google email account if they are already logged in. Is there any way to do it? Teario Something like this should work: AccountManager manager = (AccountManager) getSystemService(ACCOUNT_SERVICE); Account[] list = manager.getAccounts(); String gmail = null; for(Account account: list) { if(account.type.equalsIgnoreCase("com.google")) { gmail = account.name; break; } } And you will need the following permission in