Category/Group field for Contacts is not synchronized


  • developer

    Groups and addresses are not synced at the moment. Addresses are not trivial (see #29) and I didn’t have a look at the groups yet.



  • Great app! I would love to see group support, whenever you make it. Thank you.


  • developer

    It seems that Android (4.4) doesn’t fully support groups for external account types like DAVdroid but only for Google and Exchange accounts (hardcoded).

    Evidence:

    1. See http://androidxref.com/4.4_r1/xref/packages/apps/ContactsCommon/src/com/android/contacts/common/model/AccountTypeManager.java#417 where there’s the hardcoded differentiation between Google, Exchange and “external” accounts. So DAVdroid is initialized as ExternalAccountType.
    2. GoogleAccountType, ExchangeAccountType and ExternalAccountType are derived from BaseAccountType and the two first ones override the function isGroupMembershipEditable() to return true. However, ExternalAccountType doesn’t override the method so BaseAccountType::isGroupMembershipEditable() is used which returns false.
    3. isGroupMembershipEditable() is used from AccountTypeManager to build the list of accounts with editable groups.
    4. This list is used by ContactUtils.areGroupWritableAccountsAvailable().
    5. ContactUtils.areGroupWritableAccountsAvailable() is used by PeopleActivity::areGroupWritableAccountsAvailable() to show the “R.string.noAccounts” message.
      This message is “To create groups you need an account” in English. See also: http://stackoverflow.com/questions/17714124/how-to-add-contact-group-to-my-own-account-in-android-4-2

    HOWEVER, if an external sync adapter creates groups on its own, they’re shown correctly and users can also assign contacts to them and even create new groups from the contact details activity. So, while the contact provider (database) support for external account types with groups is available and working, the GUI is not.

    I’m not sure how to continue: It would be possible to implement group support into DAVdroid, but the Android GUI will always tell the user that DAVdroid doesn’t support groups even if it’s working. However, it only works if the first group is created by DAVdroid itself.

    Maybe a bug report to Google would be the first necessary step… so, group support is not trivial.



  • hum it is weird…
    my tests shows that CardDAV-Sync support groups on 4.4.
    groups were created using rcmcarddav (roundcube plugin).
    thanks


  • developer

    What does “support groups” mean? As I said, when there are server-side groups that are synced to the device (or when the sync adapter creates at least one group), users may assign groups to contacts but there will still be the message “To create groups you need an account” (except a Google or Exchange account is present).

    1. Is there a Google or Exchange account present on your device?
    2. If you create a new account with CardDAV sync on a device without groups (and without groups on DAV), can you create and assign a group from the GUI?


  • I did not try to edit anything (adding/removing people to group or adding/removing groups) but groups were showing in the gui.


  • developer

    I know, this is possible. However, I’d prefer a 100% working solution instead of having the GUI telling the users wrong things. People would complain immediately and think it’s a DAVdroid issue.



  • I am using Baikal to sync Mac OS X Address Book where I use groups. I see that Baikal sees groups as contacts and when I sync with Davdroid I get additional contacts which have name same as group name, but are otherwise empty. Counts also match: all contacts count on Android is now same as number of contacts in Address Book + number of groups in Address Book. I am not sure exactly what those special group contacts are, but if Davdroid does not support them, it could at least hide them/filter them out?


  • developer

    As far as I know, there are no “group contacts” in VCard so there’s no reason to filter them out. Please post details about how these VCards look (see logs).



  • This is a card for GroupName group.

    BEGIN:VCARD
    VERSION:3.0
    PRODID:-//Apple Inc.//AddressBook 6.1.3//EN
    N:GroupName
    FN:GroupName
    X-ADDRESSBOOKSERVER-KIND:group
    X-ADDRESSBOOKSERVER-MEMBER:urn:uuid:613f2ccc-600a-47ee-84cb-9b30717c9f13
    X-ADDRESSBOOKSERVER-MEMBER:urn:uuid:8ef07e3b-9dc1-4fef-862a-ee27af4296be
    X-ADDRESSBOOKSERVER-MEMBER:urn:uuid:4c48dc66-9a52-42a9-bd02-a7aed52fc989
    REV:2014-01-19T21:11:40Z
    UID:696cb4ce-792b-4b7b-833d-29727a33e9c9
    END:VCARD
    

  • developer

    @mitar This is a normal VCard with name “GroupName”. There’s no reason why a CardDAV client shouldn’t sync this.



  • But what it helps if it shows me in the contacts as a normal contact and no group? So yes, DavDroid should sync this, but then display this as a group inside Android contacts and as a person contact. So if DavDroid does not use those as groups, it should not show them in contacts, no?


  • developer

    So yes, DavDroid should sync this, but then display this as a group inside Android contacts and as a person contact.

    Groups are not supported at the moment.

    So if DavDroid does not use those as groups, it should not show them in contacts, no?

    Right, but the VCard you posted is not a group. It’s a VCard for a person with name (N) “GroupName” and full name (FN) “GroupName”. Maybe it can be interpreted as a group by parsing X-ADDRESSBOOKSERVER-, but as these are X- fields it’s not required.



  • I understand it is not required, but it could be nice to support card iCal generates? So this is what iCal pushes to Baikal which DavDroid then reads. We can pretend that everybody does everything by the standard or we can have special cases for - special cases. So for those special cards which are generated by iCal, there is completely no need to have them be shown as (empty) persons (with only name). It does not help, it is not useful, it clutters.



  • I’d have to say, this functionality has really hindered my adoption of owncloud / davdroid - a lot of my workflow works around groups for contacts. As such, this really is an essential feature.



  • Would there be any way to integrate the needed changes into projects such as OmniROM? I could see this being a massive boost to both the ROM and DavDroid…



  • I’m new to syncing Contacts using CardDAV, but I stumbled across the “groups problem” while testing some different apps. Using “ContactSync” the groups are showing up and one can assign people to different groups directly on the phone as well as create new groups before assigning people (Android 4.4.2).
    It is not possible to change the group name, create new groups in the group view (only possible for the Google account in my case) or add new contacts to these groups "the Google way "by entering the group dialog and adding them by name. The only GUI option for groups is “Delete” which seems to work (the group disappears), but the contacts can still be reassigned to this group from the contact editing screen, but the group won’t show up again. Syncing again leads to a new group with identical name (so it looks OK, but it is not).
    So everything looks like rfc2822 said before: There is some support when they are synced, but the GUI is very limited/misbehaving in managing these groups, which is very sad 😞 But even despite of these limitations it is good to have at least some functionality which enables you to use groups at all. So Google should fix/fully enable that somehow?



  • Hi,

    the missing group sync functionality for me is also the “showstopper” to use davdroid/owncloud. I tested carddav sync, and it worked very well - ok, no modification of groups and membership on the phone is possible, but at least groups appear on the phone and you can easy organize your contacts (assign contacts to groups in owncloud and use it on the phone). Every once in a while i am checking, if davdroid has implemented the feature of syncing groups (just one-way would be fine for me), but sadly there is no progress on this.

    I had a bluetooth issue with my galaxy nexus (like lots others too) - and i can tell you, that Google is not interested at all on fixing bugs!! So we should make the best out of it and implement one-way sync of groups at least. I would be very very happy if davdroid could provide this feature in the near future, since i like open-source projects more than closed source (like carddav sync / dmfs).

    I could help as “tester” if some help is needed for implementation.


  • developer

    Off-topic:

    but sadly there is no progress on this.

    I have just adopted HttpComponents 4.3.2 for Android which took more than a few hours, prepared an automatic settings updater to prepare for well-known URI support (which will also bring iCloud support!), but there are bugs everywhere. For instance, I had to report that Multiple, comma-separated challenges in WWW-Authenticate are not recognized and discuss whether this should be implemented or not (because it would possibly break non-standards-compliant Microsoft NTLM cr*p).

    My next goals are to migrate to the new HTTP library completely, then provide support for redirections (#83, #156) which is required for well-known URI support. After well-known URI support, there’s #76, #34 and #3.

    You see, there is much work to do, and even if we have it in the stores for a small fee, it’s still an open-source project and I have other work too (for a living).

    So please, be either patient or provide (after discussing and announcing it here) high-quality pull requests. Don’t get me wrong, I’ll have a look at this issue, but our priorities are clear, and the next priority milestone is well-known URI support.


  • developer

    Since 1e2051038c1e71cd16e21676051741c2c078d7f5, the CATEGORIES field will at least be retained when updating contacts.



Similar topics

  • 25
  • 8
  • 24