[android-developers] Re: Published app not showing up on HTC Evo or Droid Incredible
Alberto, Did you ever figure this out? My company has three applications and one of them is also not showing up on the Evo and possibly also not the HTC Desire. I've already checked the old copy-protection flag issue to make sure the flag was off. I'm confused as to what the issue could be and wonder if it has something to do with the manifest permissions because the application that *isn't* showing up requires many more permissions than the other two. It's frustrating and it's unclear to me how the various devices interact with the Android Market. My guess is that the installed Market application on devices can be modified by each carrier which can lead to such issues. I'm not sure... Cheers, Jerry On Jun 7, 2:02 am, Alberto afonsec...@gmail.com wrote: No, neither are running Froyo. The Evo I just picked up on Friday when it came out and haven't messed with the OS. Reading other threads here it seems most developers have given up on using copy protection altogether which is what I'm planning. It would be nice if someone from Google would address this and provide more info on the state of the feature or just remove it altogether to avoid the developer confusion and time spent researching. On Jun 6, 1:56 am, Bartinger domiii.1...@gmail.com wrote: Are the droid incr. And the evo running froyo? Because there is a security bug with android 2.2and the market On 5 Jun., 08:19, Alberto afonsec...@gmail.com wrote: Hello, I recently published our app to the marketplace and enabled copy protection. The app shows up when browsing the market on the Motorola Droid and others but does not appear when browsing with either the HTC Evo or Droid Incredible. Is this due to the copy protection? I'd like to keep my app copy protected but would like to make it available to customers of these two devices. Is this a bug or expected behavior and what are my options? -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: 2.0 AccountManager - Implementing a new account type with Google, Facebook and Exchange
The droids run 2.0, but the published Eclair source is 2.1 and that was the fastest way to get an emulator that included the Accounts Sync settings that isn't in the 2.0 emulator. AFAIK you'll need that in order to affect any testing that will work on shipping 2.0 devices. I don't have time to look into this any further at the moment as I'm currently looking into the *next* issue which is the way in which the contacts application handles contacts from account sources other than the built-in Google and Exchange sources... Cheers, Jerry On Dec 1, 8:02 pm, Dan Dumont ddum...@gmail.com wrote: Drat... I don't want to build 2.1... I thought the droids ran 2.0? anyway... I updated the project. Please let me know if it works :) I get an error still in the 2.0 emulator... 12-01 19:54:36.454: ERROR/AndroidRuntime(93): android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.settings.SYNC_SETTINGS (has extras) } On Tue, Dec 1, 2009 at 4:18 PM, Dan Dumont ddum...@gmail.com wrote: I'll update my project asap! Thanks for looking into this!! when we create the binder, do we need to verify that the account variable is for us? IE... will the intent be triggered for all providers, and we must figure out if the info is our or not? On Mon, Nov 30, 2009 at 2:35 PM, Jerry Brady jerry.br...@gmail.comwrote: Guys following this issue, I found the ultimate cause of the error and found a workaround that will allow you to work on a Droid. One thing that's helpful is building yourself an Eclair 2.1 SDK so you can use an emulator (2.1) that includes the Accounts Sync settings option we need in working with accounts: - From the the root of the android source tree: . build/envsetup.sh lunch sdk-eng make sdk (may want to use -jsomething based on your number of cores) find the SDK in out/host/linux/sdk/... From the SDK, copy platforms/android-#.# into your SDK/platform on your destination pc. If that's running windows, copy platforms/android-2.0/tools/* into your newly created platforms tools folder. Use the AVD Manager to create an AVD for this new platform. --- The crash is caused by an undocumented assumption in the Android code that handles accounts and sync. They are *very* closely related. It turns out that the Accounts and Sync settings plugin after getting the accounts on the system, uses the content service to scan for services on the system that implement the intent android.content.SyncAdapter. Since our code doesn't implement this, the search came up empty handed and since the code assumed this would never happen, BAM, null pointer exception and crash. It turns out that the solution is to have your application (or something on the system) implement a service that catches the intent android.content.SyncAdapter that returns an IBinder to an object that extends AbstractThreadedSyncAdapter (just like we did for our AbstractAccountAuthenticator). I took examples from the source code for the Email application in android, but here are the relevant bits to setup an empty sync adapter for contacts that does nothing but gets you past the exception: AndroidManifest.xml: --- - !--Required stanza to register the ContactsSyncAdapterService with SyncManager -- service android:name=com.YOURDOMAIN.YOURAPP.ContactsSyncAdapterService android:exported=true intent-filter action android:name=android.content.SyncAdapter / /intent-filter meta-data android:name=android.content.SyncAdapter android:resource=@xml/syncadapter_contacts / /service xml/syncadapter_contacts - : --- - sync-adapter xmlns:android=http://schemas.android.com/apk/res/ android android:contentAuthority=com.android.contacts android:accountType=com.YOURDOMAIN.YOURAPP / ContactSyncAdapter: = public class ContactsSyncAdapterService extends Service { private static final String TAG = ContactsSyncAdapterService; private static SyncAdapterImpl sSyncAdapter = null; private static final Object sSyncAdapterLock = new Object(); public ContactsSyncAdapterService() { super(); } private static class SyncAdapterImpl extends AbstractThreadedSyncAdapter { private Context mContext; public SyncAdapterImpl(Context context) { super(context, true /* autoInitialize */); mContext = context; } �...@override public void onPerformSync(Account account, Bundle extras, String authority, ContentProviderClient
[android-developers] Re: 2.0 AccountManager - Implementing a new account type with Google, Facebook and Exchange
Guys following this issue, I found the ultimate cause of the error and found a workaround that will allow you to work on a Droid. One thing that's helpful is building yourself an Eclair 2.1 SDK so you can use an emulator (2.1) that includes the Accounts Sync settings option we need in working with accounts: - From the the root of the android source tree: . build/envsetup.sh lunch sdk-eng make sdk (may want to use -jsomething based on your number of cores) find the SDK in out/host/linux/sdk/... From the SDK, copy platforms/android-#.# into your SDK/platform on your destination pc. If that's running windows, copy platforms/android-2.0/tools/* into your newly created platforms tools folder. Use the AVD Manager to create an AVD for this new platform. --- The crash is caused by an undocumented assumption in the Android code that handles accounts and sync. They are *very* closely related. It turns out that the Accounts and Sync settings plugin after getting the accounts on the system, uses the content service to scan for services on the system that implement the intent android.content.SyncAdapter. Since our code doesn't implement this, the search came up empty handed and since the code assumed this would never happen, BAM, null pointer exception and crash. It turns out that the solution is to have your application (or something on the system) implement a service that catches the intent android.content.SyncAdapter that returns an IBinder to an object that extends AbstractThreadedSyncAdapter (just like we did for our AbstractAccountAuthenticator). I took examples from the source code for the Email application in android, but here are the relevant bits to setup an empty sync adapter for contacts that does nothing but gets you past the exception: AndroidManifest.xml: !--Required stanza to register the ContactsSyncAdapterService with SyncManager -- service android:name=com.YOURDOMAIN.YOURAPP.ContactsSyncAdapterService android:exported=true intent-filter action android:name=android.content.SyncAdapter / /intent-filter meta-data android:name=android.content.SyncAdapter android:resource=@xml/syncadapter_contacts / /service xml/syncadapter_contacts - : sync-adapter xmlns:android=http://schemas.android.com/apk/res/ android android:contentAuthority=com.android.contacts android:accountType=com.YOURDOMAIN.YOURAPP / ContactSyncAdapter: = public class ContactsSyncAdapterService extends Service { private static final String TAG = ContactsSyncAdapterService; private static SyncAdapterImpl sSyncAdapter = null; private static final Object sSyncAdapterLock = new Object(); public ContactsSyncAdapterService() { super(); } private static class SyncAdapterImpl extends AbstractThreadedSyncAdapter { private Context mContext; public SyncAdapterImpl(Context context) { super(context, true /* autoInitialize */); mContext = context; } @Override public void onPerformSync(Account account, Bundle extras, String authority, ContentProviderClient provider, SyncResult syncResult) { try { ContactsSyncAdapterService.performSync(mContext, account, extras, authority, provider, syncResult); } catch (OperationCanceledException e) { } } } @Override public void onCreate() { super.onCreate(); synchronized (sSyncAdapterLock) { if (sSyncAdapter == null) { sSyncAdapter = new SyncAdapterImpl (getApplicationContext()); } } } @Override public IBinder onBind(Intent intent) { return sSyncAdapter.getSyncAdapterBinder(); } private static void performSync(Context context, Account account, Bundle extras, String authority, ContentProviderClient provider, SyncResult syncResult) throws OperationCanceledException { ContentResolver cr = context.getContentResolver(); Log.i(TAG, performSync: + account.toString()); } } On Nov 23, 8:46 pm, Dan Dumont ddum...@gmail.com wrote: Nice, thanks for doing that! I'll star it, I hope we get a response soon. On Mon, Nov 23, 2009 at 5:32 PM, Jerry Brady jerry.br...@gmail.com wrote: Just filed a case for this: http://code.google.com/p/android/issues/detail?id=5009 On Nov 23, 1:47 pm, Jerry Brady jerry.br...@gmail.com wrote: Dan, My code and yours both work on the Droid, but there are some nasty side-effects. After adding an account with your
[android-developers] Re: 2.0 AccountManager - Implementing a new account type with Google, Facebook and Exchange
I'm going to be trying it on a Droid this morning. On Nov 21, 10:07 pm, Dan Dumont ddum...@gmail.com wrote: I get that exception in the emulator ( doesn't reboot though ) I thought it was due to missing pieces of the emulator... does logcat output anything? On Sat, Nov 21, 2009 at 7:07 PM, NitroDesk gsuku...@gmail.com wrote: Any of you folks tried this on a Droid? Simply installing the project that contains an Authenticator in the manfest and the other related items seems to cause the Add Account option in the account list on te droid to simply reoot the phone with an exception. Anyone else seen this or find a way to avoid this ? -g On Nov 21, 9:04 am, Jerry Brady jerry.br...@gmail.com wrote: Dan, Now I see what you are doing in your code and found the reference to AddAccountExplicitly(). I want to skip returning an intent to fire the an AccountAuthenticatorActivity and instead to return KEY_ACCOUNT_NAME and KEY_ACCOUNT_TYPE directly from my AbstractAccountAuthenticator's addAccount method whereas your code returns an intent that fires your authentication activity. The main issue for me so far is that I don't see that my AbstractAccountAuthenticator is ever being instantiated. Cheers, Jerry On Nov 20, 7:53 am, Dan Dumont ddum...@gmail.com wrote: Yes. But I make the AddAccountExplicitly call in my Authenticator. You use the AccountManager to create accounts. If you call AddAccountExplicitly from a non-authenticator class, I guess it will work... But I think the security behind it will mean that only the class that created the account will be able to ever modify it or extract the password. This is why they have a framework for you to get an authtoken returned via the authenticator... the logic for authenticating should be buried within there, because it will be the only class allowed to peak at the password and send it wherever you are authenticating. On Fri, Nov 20, 2009 at 2:16 AM, sukumar bhashyam bhashyam.suku...@gmail.com wrote: AddAccountExplicitly() would need Authenticator of same type. I created an Authenticator and called AddAccountExplicitly() for the same type which created an account ( Could verify it from AccountManager.getAccounts()) One strange thing I observer is none of the implementation class functions of AbstractAccountAuthenticator is being called. I followed the exact steps in documentation. Not even onCreate or onBind function is called. Anyone seen this problem?. Is your AbstractAccountAuthenticator implemetation class being invoked?. Thanks. On Thu, Nov 19, 2009 at 8:26 PM, Jerry Brady jerry.br...@gmail.com wrote: Dan, Thanks for all of this. I just returned to the office and will be taking a look to see how much further I can get and I will certainly be interested in helping with your accounts project. I got as far as getting my account to show up in the list of accounts along with Google, Facebook and Exchange, but my service never gets called. My addAccount() method doesn't return an intent, but rather KEY_ACCOUNT_NAME and KEY_ACCOUNT_TYPE in it's bundle to let the account request succeed. My goal is to create an account that will only be used by my application and does not need to have any features to enable external authentication or account configuration. I've also tried AddAccountExplicitly() but I can't seem to get around its UID restrictions. The calling activity and the authenticator service all belong to the same application so I'm not sure why the system still throws an error about the UID not being correct. Cheers, Jerry On Nov 13, 11:54 pm, Dan Dumont ddum...@gmail.com wrote: For anyone still interested. I've made a bit of progress. The google project below now creates and lists accounts of the type for the project! On Fri, Nov 13, 2009 at 9:39 PM, Dan Dumont ddum...@gmail.com wrote: To facilitate the discussion around this topic, I've started up a project over here: http://code.google.com/p/androidaccounts/ http://code.google.com/p/androidaccounts/If anyone is interested in pitching in and writing some examples, let me know so I can add you. The current state of the project is as far as I've gotten to understanding what is available so far... and I'm stumped as to why new accounts don't seem to persist after their creation ( as far as the AccountsTester app is concerned ). On Fri, Nov 13, 2009 at 7:40 PM, Dan Dumont ddum...@gmail.com wrote: I've gotten a bit further than you. The account manager seems to want to store AccountName+Type pairs, and have anAccountAuthenticatorhandle
[android-developers] Re: 2.0 AccountManager - Implementing a new account type with Google, Facebook and Exchange
Dan, My code and yours both work on the Droid, but there are some nasty side-effects. After adding an account with your application (or mine) whenever you visit the Accounts Sync settings screen, the system crashes hard and reboots. 11-23 13:21:34.863: WARN/dalvikvm(1011): threadid=13: thread exiting with uncaught exception (group=0x4001b180) 11-23 13:21:34.863: ERROR/AndroidRuntime(1011): Uncaught handler: thread android.server.ServerThread exiting due to uncaught exception 11-23 13:21:34.879: ERROR/AndroidRuntime(1011): *** EXCEPTION IN SYSTEM PROCESS. System will crash. 11-23 13:21:34.879: ERROR/AndroidRuntime(1011): java.lang.NullPointerException 11-23 13:21:34.879: ERROR/AndroidRuntime(1011): at com.android.settings.ManageAccountsSettings.onSyncStateUpdated (ManageAccountsSettings.java:187) 11-23 13:21:34.879: ERROR/AndroidRuntime(1011): at com.android.settings.ManageAccountsSettings.onAccountsUpdated (ManageAccountsSettings.java:244) 11-23 13:21:34.879: ERROR/AndroidRuntime(1011): at android.accounts.AccountManager$10.run(AccountManager.java:389) 11-23 13:21:34.879: ERROR/AndroidRuntime(1011): at android.os.Handler.handleCallback(Handler.java:587) 11-23 13:21:34.879: ERROR/AndroidRuntime(1011): at android.os.Handler.dispatchMessage(Handler.java:92) 11-23 13:21:34.879: ERROR/AndroidRuntime(1011): at android.os.Looper.loop(Looper.java:123) 11-23 13:21:34.879: ERROR/AndroidRuntime(1011): at com.android.server.ServerThread.run(SystemServer.java:428) I'm looking at the source now to see if I can figure out what's going on. If necessary, I'll file a case with the project if I find a bug in the Android source. Cheers, Jerry On Nov 23, 8:18 am, Jerry Brady jerry.br...@gmail.com wrote: I'm going to be trying it on a Droid this morning. On Nov 21, 10:07 pm, Dan Dumont ddum...@gmail.com wrote: I get that exception in the emulator ( doesn't reboot though ) I thought it was due to missing pieces of the emulator... does logcat output anything? On Sat, Nov 21, 2009 at 7:07 PM, NitroDesk gsuku...@gmail.com wrote: Any of you folks tried this on a Droid? Simply installing the project that contains an Authenticator in the manfest and the other related items seems to cause the Add Account option in the account list on te droid to simply reoot the phone with an exception. Anyone else seen this or find a way to avoid this ? -g On Nov 21, 9:04 am, Jerry Brady jerry.br...@gmail.com wrote: Dan, Now I see what you are doing in your code and found the reference to AddAccountExplicitly(). I want to skip returning an intent to fire the an AccountAuthenticatorActivity and instead to return KEY_ACCOUNT_NAME and KEY_ACCOUNT_TYPE directly from my AbstractAccountAuthenticator's addAccount method whereas your code returns an intent that fires your authentication activity. The main issue for me so far is that I don't see that my AbstractAccountAuthenticator is ever being instantiated. Cheers, Jerry On Nov 20, 7:53 am, Dan Dumont ddum...@gmail.com wrote: Yes. But I make the AddAccountExplicitly call in my Authenticator. You use theAccountManagerto create accounts. If you call AddAccountExplicitly from a non-authenticator class, I guess it will work... But I think the security behind it will mean that only the class that created the account will be able to ever modify it or extract the password. This is why they have a framework for you to get an authtoken returned via the authenticator... the logic for authenticating should be buried within there, because it will be the only class allowed to peak at the password and send it wherever you are authenticating. On Fri, Nov 20, 2009 at 2:16 AM, sukumar bhashyam bhashyam.suku...@gmail.com wrote: AddAccountExplicitly() would need Authenticator of same type. I created an Authenticator and called AddAccountExplicitly() for the same type which created an account ( Could verify it from AccountManager.getAccounts()) One strange thing I observer is none of the implementation class functions of AbstractAccountAuthenticator is being called. I followed the exact steps in documentation. Not even onCreate or onBind function is called. Anyone seen this problem?. Is your AbstractAccountAuthenticator implemetation class being invoked?. Thanks. On Thu, Nov 19, 2009 at 8:26 PM, Jerry Brady jerry.br...@gmail.com wrote: Dan, Thanks for all of this. I just returned to the office and will be taking a look to see how much further I can get and I will certainly be interested in helping with your accounts project. I got as far as getting my account to show up in the list of accounts along with Google, Facebook and Exchange, but my service never gets
[android-developers] Re: 2.0 AccountManager - Implementing a new account type with Google, Facebook and Exchange
Just filed a case for this: http://code.google.com/p/android/issues/detail?id=5009 On Nov 23, 1:47 pm, Jerry Brady jerry.br...@gmail.com wrote: Dan, My code and yours both work on the Droid, but there are some nasty side-effects. After adding an account with your application (or mine) whenever you visit the Accounts Sync settings screen, the system crashes hard and reboots. 11-23 13:21:34.863: WARN/dalvikvm(1011): threadid=13: thread exiting with uncaught exception (group=0x4001b180) 11-23 13:21:34.863: ERROR/AndroidRuntime(1011): Uncaught handler: thread android.server.ServerThread exiting due to uncaught exception 11-23 13:21:34.879: ERROR/AndroidRuntime(1011): *** EXCEPTION IN SYSTEM PROCESS. System will crash. 11-23 13:21:34.879: ERROR/AndroidRuntime(1011): java.lang.NullPointerException 11-23 13:21:34.879: ERROR/AndroidRuntime(1011): at com.android.settings.ManageAccountsSettings.onSyncStateUpdated (ManageAccountsSettings.java:187) 11-23 13:21:34.879: ERROR/AndroidRuntime(1011): at com.android.settings.ManageAccountsSettings.onAccountsUpdated (ManageAccountsSettings.java:244) 11-23 13:21:34.879: ERROR/AndroidRuntime(1011): at android.accounts.AccountManager$10.run(AccountManager.java:389) 11-23 13:21:34.879: ERROR/AndroidRuntime(1011): at android.os.Handler.handleCallback(Handler.java:587) 11-23 13:21:34.879: ERROR/AndroidRuntime(1011): at android.os.Handler.dispatchMessage(Handler.java:92) 11-23 13:21:34.879: ERROR/AndroidRuntime(1011): at android.os.Looper.loop(Looper.java:123) 11-23 13:21:34.879: ERROR/AndroidRuntime(1011): at com.android.server.ServerThread.run(SystemServer.java:428) I'm looking at the source now to see if I can figure out what's going on. If necessary, I'll file a case with the project if I find a bug in the Android source. Cheers, Jerry On Nov 23, 8:18 am, Jerry Brady jerry.br...@gmail.com wrote: I'm going to be trying it on a Droid this morning. On Nov 21, 10:07 pm, Dan Dumont ddum...@gmail.com wrote: I get that exception in the emulator ( doesn't reboot though ) I thought it was due to missing pieces of the emulator... does logcat output anything? On Sat, Nov 21, 2009 at 7:07 PM, NitroDesk gsuku...@gmail.com wrote: Any of you folks tried this on a Droid? Simply installing the project that contains an Authenticator in the manfest and the other related items seems to cause the Add Account option in the account list on te droid to simply reoot the phone with an exception. Anyone else seen this or find a way to avoid this ? -g On Nov 21, 9:04 am, Jerry Brady jerry.br...@gmail.com wrote: Dan, Now I see what you are doing in your code and found the reference to AddAccountExplicitly(). I want to skip returning an intent to fire the an AccountAuthenticatorActivity and instead to return KEY_ACCOUNT_NAME and KEY_ACCOUNT_TYPE directly from my AbstractAccountAuthenticator's addAccount method whereas your code returns an intent that fires your authentication activity. The main issue for me so far is that I don't see that my AbstractAccountAuthenticator is ever being instantiated. Cheers, Jerry On Nov 20, 7:53 am, Dan Dumont ddum...@gmail.com wrote: Yes. But I make the AddAccountExplicitly call in my Authenticator. You use theAccountManagerto create accounts. If you call AddAccountExplicitly from a non-authenticator class, I guess it will work... But I think the security behind it will mean that only the class that created the account will be able to ever modify it or extract the password. This is why they have a framework for you to get an authtoken returned via the authenticator... the logic for authenticating should be buried within there, because it will be the only class allowed to peak at the password and send it wherever you are authenticating. On Fri, Nov 20, 2009 at 2:16 AM, sukumar bhashyam bhashyam.suku...@gmail.com wrote: AddAccountExplicitly() would need Authenticator of same type. I created an Authenticator and called AddAccountExplicitly() for the same type which created an account ( Could verify it from AccountManager.getAccounts()) One strange thing I observer is none of the implementation class functions of AbstractAccountAuthenticator is being called. I followed the exact steps in documentation. Not even onCreate or onBind function is called. Anyone seen this problem?. Is your AbstractAccountAuthenticator implemetation class being invoked?. Thanks. On Thu, Nov 19, 2009 at 8:26 PM, Jerry Brady jerry.br...@gmail.com wrote: Dan, Thanks for all of this. I just returned to the office and will be taking a look
[android-developers] Re: 2.0 AccountManager - Implementing a new account type with Google, Facebook and Exchange
Sukumar, I see the exact same behavior in my code. It's confusing. Everything seems to be setup properly, but the system never invokes by implementation of AbstractAccountAuthenticator. My assumption was that by defining the proper service and intent in the manifest, the account settings manager would pick this up and call my service from the Accounts Sync menu when someone chooses to manipulate an account of my type. However, since my primary intention is to create an account for use only by my application, if I can get addAccountExplicitly working, I'll should be happy. Nevertheless, I want to understand this part of the system. So if your AbstractAccountAuthenticator isn't being invoked, how can you be calling addAccountExplicitly from within that class? Cheers, Jerry On Nov 20, 2:16 am, sukumar bhashyam bhashyam.suku...@gmail.com wrote: AddAccountExplicitly() would need Authenticator of same type. I created an Authenticator and called AddAccountExplicitly() for the same type which created an account ( Could verify it from AccountManager.getAccounts()) One strange thing I observer is none of the implementation class functions of AbstractAccountAuthenticator is being called. I followed the exact steps in documentation. Not even onCreate or onBind function is called. Anyone seen this problem?. Is your AbstractAccountAuthenticator implemetation class being invoked?. Thanks. On Thu, Nov 19, 2009 at 8:26 PM, Jerry Brady jerry.br...@gmail.com wrote: Dan, Thanks for all of this. I just returned to the office and will be taking a look to see how much further I can get and I will certainly be interested in helping with your accounts project. I got as far as getting my account to show up in the list of accounts along with Google, Facebook and Exchange, but my service never gets called. My addAccount() method doesn't return an intent, but rather KEY_ACCOUNT_NAME and KEY_ACCOUNT_TYPE in it's bundle to let the account request succeed. My goal is to create an account that will only be used by my application and does not need to have any features to enable external authentication or account configuration. I've also tried AddAccountExplicitly() but I can't seem to get around its UID restrictions. The calling activity and the authenticator service all belong to the same application so I'm not sure why the system still throws an error about the UID not being correct. Cheers, Jerry On Nov 13, 11:54 pm, Dan Dumont ddum...@gmail.com wrote: For anyone still interested. I've made a bit of progress. The google project below now creates and lists accounts of the type for the project! On Fri, Nov 13, 2009 at 9:39 PM, Dan Dumont ddum...@gmail.com wrote: To facilitate the discussion around this topic, I've started up a project over here: http://code.google.com/p/androidaccounts/ http://code.google.com/p/androidaccounts/If anyone is interested in pitching in and writing some examples, let me know so I can add you. The current state of the project is as far as I've gotten to understanding what is available so far... and I'm stumped as to why new accounts don't seem to persist after their creation ( as far as the AccountsTester app is concerned ). On Fri, Nov 13, 2009 at 7:40 PM, Dan Dumont ddum...@gmail.com wrote: I've gotten a bit further than you. The account manager seems to want to store AccountName+Type pairs, and have an AccountAuthenticator handle the storage and dirty bits of the actual authentication and credential storage. You will need to create an AccountAuthenticator from the AbstractAccountAuthenticator class. You will also need to define a Service in your app. See http://developer.android.com/reference/android/accounts/AbstractAccou. .. This service must be set up in the Manifest like so: (ripped from link above) intent-filter action android:name=android.accounts.AccountAuthenticator / /intent-filter meta-data android:name=android.accounts.AccountAuthenticator android:resource=@xml/authenticator / You can take a look at the link for what the resource must be... After you end up hooking all that crap up, you can do this in your service: public IBinder onBind(Intent intent) { IBinder ret = null; if (intent.getAction().equals(android.accounts.AccountManager.ACTION_AUTHENTIC ATOR_INTENT)) ret = getAuthenticator().getIBinder(); return ret; } private AccountAuthenticator getSametimeAuthenticator() { if (_aa == null) _aa = new AccountAuthenticator(this); return _aa; } So when you finally have all this set up. You should see your account type listed in the AccountTester application next to the Corporate type. To get anything meaningful to happen when you click Add, you need to do this in your
[android-developers] Re: 2.0 AccountManager - Implementing a new account type with Google, Facebook and Exchange
Dan, I didn't see this call in your current Google code project. Is your use of AddAccountExplicitly() in there? Cheers, Jerry On Nov 20, 7:53 am, Dan Dumont ddum...@gmail.com wrote: Yes. But I make the AddAccountExplicitly call in my Authenticator. You use the AccountManager to create accounts. If you call AddAccountExplicitly from a non-authenticator class, I guess it will work... But I think the security behind it will mean that only the class that created the account will be able to ever modify it or extract the password. This is why they have a framework for you to get an authtoken returned via the authenticator... the logic for authenticating should be buried within there, because it will be the only class allowed to peak at the password and send it wherever you are authenticating. On Fri, Nov 20, 2009 at 2:16 AM, sukumar bhashyam bhashyam.suku...@gmail.com wrote: AddAccountExplicitly() would need Authenticator of same type. I created an Authenticator and called AddAccountExplicitly() for the same type which created an account ( Could verify it from AccountManager.getAccounts()) One strange thing I observer is none of the implementation class functions of AbstractAccountAuthenticator is being called. I followed the exact steps in documentation. Not even onCreate or onBind function is called. Anyone seen this problem?. Is your AbstractAccountAuthenticator implemetation class being invoked?. Thanks. On Thu, Nov 19, 2009 at 8:26 PM, Jerry Brady jerry.br...@gmail.comwrote: Dan, Thanks for all of this. I just returned to the office and will be taking a look to see how much further I can get and I will certainly be interested in helping with your accounts project. I got as far as getting my account to show up in the list of accounts along with Google, Facebook and Exchange, but my service never gets called. My addAccount() method doesn't return an intent, but rather KEY_ACCOUNT_NAME and KEY_ACCOUNT_TYPE in it's bundle to let the account request succeed. My goal is to create an account that will only be used by my application and does not need to have any features to enable external authentication or account configuration. I've also tried AddAccountExplicitly() but I can't seem to get around its UID restrictions. The calling activity and the authenticator service all belong to the same application so I'm not sure why the system still throws an error about the UID not being correct. Cheers, Jerry On Nov 13, 11:54 pm, Dan Dumont ddum...@gmail.com wrote: For anyone still interested. I've made a bit of progress. The google project below now creates and lists accounts of the type for the project! On Fri, Nov 13, 2009 at 9:39 PM, Dan Dumont ddum...@gmail.com wrote: To facilitate the discussion around this topic, I've started up a project over here: http://code.google.com/p/androidaccounts/ http://code.google.com/p/androidaccounts/If anyone is interested in pitching in and writing some examples, let me know so I can add you. The current state of the project is as far as I've gotten to understanding what is available so far... and I'm stumped as to why new accounts don't seem to persist after their creation ( as far as the AccountsTester app is concerned ). On Fri, Nov 13, 2009 at 7:40 PM, Dan Dumont ddum...@gmail.com wrote: I've gotten a bit further than you. The account manager seems to want to store AccountName+Type pairs, and have an AccountAuthenticator handle the storage and dirty bits of the actual authentication and credential storage. You will need to create an AccountAuthenticator from the AbstractAccountAuthenticator class. You will also need to define a Service in your app. See http://developer.android.com/reference/android/accounts/AbstractAccou... This service must be set up in the Manifest like so: (ripped from link above) intent-filter action android:name=android.accounts.AccountAuthenticator / /intent-filter meta-data android:name=android.accounts.AccountAuthenticator android:resource=@xml/authenticator / You can take a look at the link for what the resource must be... After you end up hooking all that crap up, you can do this in your service: public IBinder onBind(Intent intent) { IBinder ret = null; if (intent.getAction().equals(android.accounts.AccountManager.ACTION_AUTHENTIC ATOR_INTENT)) ret = getAuthenticator().getIBinder(); return ret; } private AccountAuthenticator getSametimeAuthenticator() { if (_aa == null) _aa = new AccountAuthenticator(this); return _aa; } So when you finally have all this set up. You should see your account type listed in the AccountTester application next to the Corporate type. To get anything meaningful to happen
[android-developers] Re: 2.0 AccountManager - Implementing a new account type with Google, Facebook and Exchange
Dan, Now I see what you are doing in your code and found the reference to AddAccountExplicitly(). I want to skip returning an intent to fire the an AccountAuthenticatorActivity and instead to return KEY_ACCOUNT_NAME and KEY_ACCOUNT_TYPE directly from my AbstractAccountAuthenticator's addAccount method whereas your code returns an intent that fires your authentication activity. The main issue for me so far is that I don't see that my AbstractAccountAuthenticator is ever being instantiated. Cheers, Jerry On Nov 20, 7:53 am, Dan Dumont ddum...@gmail.com wrote: Yes. But I make the AddAccountExplicitly call in my Authenticator. You use the AccountManager to create accounts. If you call AddAccountExplicitly from a non-authenticator class, I guess it will work... But I think the security behind it will mean that only the class that created the account will be able to ever modify it or extract the password. This is why they have a framework for you to get an authtoken returned via the authenticator... the logic for authenticating should be buried within there, because it will be the only class allowed to peak at the password and send it wherever you are authenticating. On Fri, Nov 20, 2009 at 2:16 AM, sukumar bhashyam bhashyam.suku...@gmail.com wrote: AddAccountExplicitly() would need Authenticator of same type. I created an Authenticator and called AddAccountExplicitly() for the same type which created an account ( Could verify it from AccountManager.getAccounts()) One strange thing I observer is none of the implementation class functions of AbstractAccountAuthenticator is being called. I followed the exact steps in documentation. Not even onCreate or onBind function is called. Anyone seen this problem?. Is your AbstractAccountAuthenticator implemetation class being invoked?. Thanks. On Thu, Nov 19, 2009 at 8:26 PM, Jerry Brady jerry.br...@gmail.comwrote: Dan, Thanks for all of this. I just returned to the office and will be taking a look to see how much further I can get and I will certainly be interested in helping with your accounts project. I got as far as getting my account to show up in the list of accounts along with Google, Facebook and Exchange, but my service never gets called. My addAccount() method doesn't return an intent, but rather KEY_ACCOUNT_NAME and KEY_ACCOUNT_TYPE in it's bundle to let the account request succeed. My goal is to create an account that will only be used by my application and does not need to have any features to enable external authentication or account configuration. I've also tried AddAccountExplicitly() but I can't seem to get around its UID restrictions. The calling activity and the authenticator service all belong to the same application so I'm not sure why the system still throws an error about the UID not being correct. Cheers, Jerry On Nov 13, 11:54 pm, Dan Dumont ddum...@gmail.com wrote: For anyone still interested. I've made a bit of progress. The google project below now creates and lists accounts of the type for the project! On Fri, Nov 13, 2009 at 9:39 PM, Dan Dumont ddum...@gmail.com wrote: To facilitate the discussion around this topic, I've started up a project over here: http://code.google.com/p/androidaccounts/ http://code.google.com/p/androidaccounts/If anyone is interested in pitching in and writing some examples, let me know so I can add you. The current state of the project is as far as I've gotten to understanding what is available so far... and I'm stumped as to why new accounts don't seem to persist after their creation ( as far as the AccountsTester app is concerned ). On Fri, Nov 13, 2009 at 7:40 PM, Dan Dumont ddum...@gmail.com wrote: I've gotten a bit further than you. The account manager seems to want to store AccountName+Type pairs, and have an AccountAuthenticator handle the storage and dirty bits of the actual authentication and credential storage. You will need to create an AccountAuthenticator from the AbstractAccountAuthenticator class. You will also need to define a Service in your app. See http://developer.android.com/reference/android/accounts/AbstractAccou... This service must be set up in the Manifest like so: (ripped from link above) intent-filter action android:name=android.accounts.AccountAuthenticator / /intent-filter meta-data android:name=android.accounts.AccountAuthenticator android:resource=@xml/authenticator / You can take a look at the link for what the resource must be... After you end up hooking all that crap up, you can do this in your service: public IBinder onBind(Intent intent) { IBinder ret = null; if (intent.getAction().equals(android.accounts.AccountManager.ACTION_AUTHENTIC ATOR_INTENT)) ret = getAuthenticator
[android-developers] Re: 2.0 AccountManager - Implementing a new account type with Google, Facebook and Exchange
if you had no Activity to enter credentials is passed back with setAccountAuthenticatorResult(result); and finish(); That's about as far as i've gotten. When i click Add in the AccountsTester app, the activity to enter creds is launched, and whent he done button is pressed I get this message in the LogCat: 11-13 19:21:58.488: DEBUG/AccountsTester(291): account added: Bundle[{accountType=com.my.package.app.auth.account_type, authAccount=testaccout}] But the AccountsTester app refuses to display my accounts that it said it created. without being able to look at the source for at least the AccountsTester app, I'm pretty stuck right now... Does anyone out there have ANY useful information on how to use this stuff? Or is it all locked up in a buttbuddy secret vault between google and motorola? On Thu, Nov 12, 2009 at 8:27 PM, Jerry Brady jerry.br...@gmail.comwrote: I'm trying to hook up a new account for an application to use that will ultimately sync PIM data. The application is already working for API levels 3 4, but at API 5, I'm having some trouble with the introduction of accounts and the AccountManager. I've searched the groups and the docs and gotten part way there, but for some reason there isn't any I can get an actual account created. I've tried both on the Moto Droid and in the emulator. I have a service that implements everything as required by the documentation for AbstractAccountAuthenticator. I've confirmed that my account is not present my iterating the results from AccountManager.getAccounts(). My service's authenticator shows up in when I iterate the result from AccountManager.getAuthenticatorTypes(). The name and package are both listed. But when I have an activity call to add an account with AddAccount, the call returns, but the future bundle never finishes. There is nothing in logs indicates anything is happening and it's almost as if there is an Intent fired by the call to addAccount() that I'm not setup to catch. Since the eclair source isn't available yet, I can't look into it on my own and I'm asking for some help from people who know this part of 2.0 or have access to the source to help me find what I am missing. In my activity, after using an initialized AccountManager to check my account, I call to set one up: private final static String MY_ACCOUNT_TYPE = com.mydomain; AccountManager am = AccountManager.get(context); AccountManagerFutureBundle future; Bundle result; future = am.addAccount(MS_ACCOUNT_TYPE, null, null, null, null, null, null); Log.d(TAG, returned from am.AddAccount); try { result = future.getResult(); } catch When run, getResult() never finishes, ultimately blocking my activity until it's stopped. I don't know where the system goes after my call to getResult(). The service I have created is configured just the like example from the docs: service android:enabled=true android:exported=true android:name=AccountService android:label=Sync Account intent-filter action android:name=android.accounts.AccountAuthenticator / /intent-filter meta-data android:name=android.accounts.AccountAuthenticator android:resource=@xml/authenticator / /service I'm wondering if there is a different intent I need to catch for account creation. All of the service's lifecycle methods have overrides and logging. It doesn't look as if my authenticator service is ever instantiated. The only other question I had was in AbstractAccountAuthenticator because the docs read that you must extend this class and return the correct value for getIBinder(). Since you can't extend from more than one class, I assumed this meant I needed to have my AccountAuthenticator class treat the abstract class as an interface and the class extends Binder to support the getIBinder() method. I'd appreciate any insight or help anyone can offer. Cheers, Jerry -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.comandroid-developers%2Bunsubs cr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: com.google Authenticator for the new android.accounts.AccountManager API.
Micah, Thanks for this because I'm working in the same area and I'm currently stuck. I looked over the source code project you posted (I haven't tried to run it yet). I don't see how the service's call to lAuthenticator.getIBinder() will succeed. Won't that just throw a NoSuchMethodException? My code appears to work and I can get my icon in the list of accounts for the Accounts Sync settings applications Add account feature, but my service never gets started by the system and I'm not sure why. I'd be happy to work with you hard and long on this one. I have about two days to get something working before I have to leave town. Cheers, Jerry -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] 2.0 AccountManager - Implementing a new account type with Google, Facebook and Exchange
I'm trying to hook up a new account for an application to use that will ultimately sync PIM data. The application is already working for API levels 3 4, but at API 5, I'm having some trouble with the introduction of accounts and the AccountManager. I've searched the groups and the docs and gotten part way there, but for some reason there isn't any I can get an actual account created. I've tried both on the Moto Droid and in the emulator. I have a service that implements everything as required by the documentation for AbstractAccountAuthenticator. I've confirmed that my account is not present my iterating the results from AccountManager.getAccounts(). My service's authenticator shows up in when I iterate the result from AccountManager.getAuthenticatorTypes(). The name and package are both listed. But when I have an activity call to add an account with AddAccount, the call returns, but the future bundle never finishes. There is nothing in logs indicates anything is happening and it's almost as if there is an Intent fired by the call to addAccount() that I'm not setup to catch. Since the eclair source isn't available yet, I can't look into it on my own and I'm asking for some help from people who know this part of 2.0 or have access to the source to help me find what I am missing. In my activity, after using an initialized AccountManager to check my account, I call to set one up: private final static String MY_ACCOUNT_TYPE = com.mydomain; AccountManager am = AccountManager.get(context); AccountManagerFutureBundle future; Bundle result; future = am.addAccount(MS_ACCOUNT_TYPE, null, null, null, null, null, null); Log.d(TAG, returned from am.AddAccount); try { result = future.getResult(); } catch When run, getResult() never finishes, ultimately blocking my activity until it's stopped. I don't know where the system goes after my call to getResult(). The service I have created is configured just the like example from the docs: service android:enabled=true android:exported=true android:name=AccountService android:label=Sync Account intent-filter action android:name=android.accounts.AccountAuthenticator / /intent-filter meta-data android:name=android.accounts.AccountAuthenticator android:resource=@xml/authenticator / /service I'm wondering if there is a different intent I need to catch for account creation. All of the service's lifecycle methods have overrides and logging. It doesn't look as if my authenticator service is ever instantiated. The only other question I had was in AbstractAccountAuthenticator because the docs read that you must extend this class and return the correct value for getIBinder(). Since you can't extend from more than one class, I assumed this meant I needed to have my AccountAuthenticator class treat the abstract class as an interface and the class extends Binder to support the getIBinder() method. I'd appreciate any insight or help anyone can offer. Cheers, Jerry -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en