The answer is: yes you do.  Your sync adapter will need to "adopt" the
no-account contacts, otherwise some other syncadapter will claim them and
then synchronization will become impossible.  The no-account contacts
literally have accountType=NULL so they are easy to find.  Find them and
assign the account type/name right away.  Please note that once you have a
sync adapter in the system,  you can no longer create any no-account
contacts.  At least that is true for the stock implementation of Android.

Cheers,
- Dmitri

On Sun, Jan 23, 2011 at 2:14 AM, L0rdAli3n
<[email protected]>wrote:

> Thanks for those informationen Dmitri.
>
> To make it clear: I "just" want to sync the contacts a user saved on
> his
> local phonebook/adressbook (no gmailcontacts, no facebookcontacts, no
> twittercontacts)
> with openXChange. Do I really need a new AccountType then? So a user
> will have a openXChange-Contacts, beside the phonebook-Contacts?
>
> On 19 Jan., 09:02, Dmitri Plotnikov <[email protected]> wrote:
> > I am sorry. I guess I just don't understand the requirements.  I thought
> you
> > were writing a sync adapter.  Sync adapters all deal with their own
> > accounts.  Google sync adapter deals with google accounts, exchange
> adapter
> > with exchange accounts and so on.  If you are thinking of writing a sync
> > adapter that would handle data already handled by some other sync
> adapter,
> > it is probably a bad idea. The framework is not designed to have multiple
> > sync adapters handling the same data: only one syncadapter can take
> > advantage of data versioning. This why I suggested that if you are
> writing a
> > sync adapter, you should introduce a new account type. This is how they
> are
> > supposed to work by design.
> >
> > Cheers,
> > Dmitri
> > On Jan 18, 2011 5:43 PM, "L0rdAli3n" <[email protected]>
> > wrote:
> >
> > > Thanks for your answer Dmitri!
> >
> > > Could you explain in few words, how I can use the contacts the user
> > > stored on his phone,
> > > which in fact all have already an account_type, by introducing my own
> > > accout_type?
> >
> > > On 14 Jan., 16:26, Dmitri Plotnikov <[email protected]> wrote:
> > >> I don't fully understand your requirements, but it shouldn't matter
> what
> > >> _other_ data is in the contacts DB.  A sync adapter should only deal
> with
> > >> its own data. Why not introduce a new account type for this purpose?
> >
> > >> Cheers,
> > >> Dmitri
> > >> On Jan 14, 2011 5:16 AM, "L0rdAli3n" <[email protected]
> >
> > >> wrote:
> >
> > >> > Hey,
> >
> > >> > I'm totally stuck with the ContactsContract-API. Point is that I
> want
> > >> > only mess around with the Contacts saved in the "local" phonebook.
> But
> > >> > it seems that every vendor but its own account_type for those
> > >> > contacts.
> > >> > And its even worse. The AccountManager isn't even aware of all
> > >> > account_types?!?
> > >> > For example on my HTC Desire with HTC Sense, the account_type all
> > >> > local contacts are saved in is: com.htc.android.pcsc. But when I
> grab
> > >> > a list of all available accounts from the AccountManager: This
> account
> > >> > is not in the list!?
> > >> > I also tested it on a Samsung Galaxy. Same here: The AccountManager
> is
> > >> > not aware of the account_type used for local phonebookcontacts.
> >
> > >> > The whole story is that I wan't to write a app to sync my locale
> > >> > phonebook with OpenXchange.
> >
> > >> > I guess I got that whole new ContactsContract-API wrong, but I don't
> > >> > see any other way, then using RawContacts. Due to that I have to
> care
> > >> > about the account_type, which is in fact a total mess.
> >
> > >> > Hopefully someone can point me in the right direction. Every hint is
> > >> > highly appreciated.
> >
> > >> > --
> > >> > You received this message because you are subscribed to the Google
> > >> > Groups "Android Developers" group.
> > >> > To post to this group, send email to
> >
> > [email protected]>> > To unsubscribe from this group,
> send email to
> > >> > [email protected]<android-developers%[email protected]>
> <android-developers%[email protected]<android-developers%[email protected]>
> >
> >
> > <android-developers%[email protected]<android-developers%[email protected]>
> <android-developers%[email protected]<android-developers%[email protected]>
> >
> >
> >
> >
> > >> > 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
> [email protected]
> > > To unsubscribe from this group, send email to
> > > [email protected]<android-developers%[email protected]>
> <android-developers%[email protected]<android-developers%[email protected]>
> >
> > > 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 [email protected]
> To unsubscribe from this group, send email to
> [email protected]<android-developers%[email protected]>
> 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 [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to