Category/Group field for Contacts is not synchronized



  • Hello,

    the category filed of contacts is used to build the groups of contacts on Android (at least on my device). So id would by nice if this information would by synchronized too.



  • Apparently it looks like groups are synchronized but not correctly.
    So they are missing from the stock "contacts" app (1st tab, the group tab).
    I can see the groups as duplicate entries in the 2nd tab (contact tab).

    With the same addressbook (so, same data) synchronized with "CardDAV-Sync free", it works as expected.

    Using android 4.3 stock rooted on galaxy nexus.



  • In my case the groups are nowhere to see. Neither in the group tab, nor in the contact itself.

    I'm not able to add a contatct to a group because the 'group' item is missed in the list of addable items.

    I'm using AOSM 4.3.1 (CM10.2-20131026-nightly)



  • Even addresses are missing

    jeekajoo notifications@github.com schrieb:

    Apparently it looks like groups are synchronized but missing from the
    stock "contacts" app (1st tab, the group tab):
    I can see the groups as duplicate entries in the 2nd tab (contact tab).

    With the same addressbook (so, same data) synchronized with
    "CardDAV-Sync free", it works as expected.

    Using android 4.3 stock rooted on galaxy nexus.


    Reply to this email directly or view it on GitHub:
    https://github.com/rfc2822/davdroid/issues/48#issuecomment-27257174

    --
    Diese Nachricht wurde von meinem Android-Mobiltelefon mit K-9 Mail gesendet.


  • 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....



Looks like your connection to Bitfire App Forums was lost, please wait while we try to reconnect.