views:

70

answers:

1

I know that you can setup accounts in Android 2.0+ and thats great but as i have recently found out, it can create duplication.

My phone(Sprint HTC hero 2.1-upadate1) comes with HTC Sense and thats great, it also has Peep pre-installed and it asked me when i setup the phone to add a twitter account, and so i did. I can now open peep and it all works, perfect.

But I decided i wanted to try the Twitter for Android app. I installed it and it also asked me to create a twitter account, not good. I did create the new account and the app worked just like it was supposed to.

Then when i go into my accounts i can see that i have two twitter accounts(the same one). Is this something that can be avoided in the programming or is this something that can be fixed with the os?

I also noticed the same for the facebook account. Is there something in the SDK that can prevent this...or combine the accounts after the fact? or is this all completely up to the developers.

If its up to the developers then i would really like to see some code/documentation so i can avoid such things.

+1  A: 

Accounts on Android have a notion of account 'types'; see AccountManager for details. For example, Google Accounts are of the type com.google. Peep and the Twitter for Android apps may be using different account types, and may not be using compatible authentication tokens (also see AccountManager and AbstractAccountAuthenticator). More on accounts and authenticators can be found in the SampleSyncAdapter SDK sample code.

The 'right' thing to do in my opinion is for developers to standardize on and document account types for services they're consuming, provide account authenticators for those account types, and then authenticate to said services using tokens obtained via AccountManager. There are also many opportunities to integrate deeper with contacts, sync, etc.

Roman Nurik
Thank you for the reply
Stoyan