Menu

AndroidCardDAVSync

[Clients] WebDAV CardDAV

CardDAV-Sync (Android)

Product Home Page

User Agent String: CardDAV-Sync (Android) (like iOS/5.0.1 (9A405) dataaccessd/1.0) gzip
OpenGrouwpare Coils Client Id: 11e687c2-4cea-4464-a31c-5d9f97f8c6f4
Status: Working, as of 0.1.49pre

Appears to support Service Discovery. But it does not perform a GET and follow the 301 redirect... it performs a PROPFIND. Is that standard?

Notes.

  • The paid version syncs more fields than the free version.
  • The Android 3.x platform was deliberately broken in several ways in order to push users toward use of proprietary services; one side effect of this is to use a third-party backend you also need to install a third-party contact editor. But you can easily make this your default editor. The recommended editor is "Contact Editor Pro"; either the free version or the paid version. The free version is the same as the stock editor - only with the breakage regarding third-party backends triaged.
    • The native contact editor in Android 4.x works with CardDAV backends.
  • There are known issues regarding the HTC One device.
  • Contact lists do not work. These appear to be deliberately broken.
  • The user principal needs to be a collections. So user agent definition maps the user principal to "/dav/Contacts/"
  • It requires that collection paths end in a "/".
  • Requires that contact collections publish an "addressbook" resource type.
  • [#70] : Support addressbook-home-set WebDAV property

Discovery Request

Coils correctly responds to the well_known PROPFIND with a 301 to /dav/Contacts. This results in a PROPFIND of /dav/Contacts/ asking about the current user principal.

PROPFIND /dav/Contacts/ HTTP/1.0
Connection: close
Content-Type: application/xml; charset="utf-8"
Depth: 0
Content-Length: 123
User-Agent: CardDAV-Sync (Android) (like iOS/5.0.1 (9A405) dataaccessd/1.0) gzip
Authorization: Basic YXdpbGxpYW06OmZyZWQxMg==
Accept-Encoding: gzip

<?xml version="1.0" encoding="utf-8" ?>
<A:propfind xmlns:A="DAV:">
    <A:prop><A:current-user-principal/></A:prop>
</A:propfind>

Response

<?xml version="1.0" encoding="utf-8"?>
<D:multistatus xmlns:G="http://groupdav.org/" xmlns:E="urn:ietf:params:xml:ns:carddav" xmlns:D="DAV:" xmlns:C="urn:ietf:params:xml:ns:caldav" xmlns:B="http://icewarp.com/ns/" xmlns:A="http://apache.org/dav/props/">
    <D:response><D:href>/dav/Contacts</D:href>
        <D:propstat>
          <D:status>HTTP/1.1 200 OK</D:status>
          <D:prop>
            <D:current-user-principal><D:href>/dav/Contacts/</D:href></D:current-user-principal>
          </D:prop>
        </D:propstat>
     </D:response>
</D:multistatus>

The client then sends a PROPFIND to the URL of the current user principal.

PROPFIND /dav/Contacts/ HTTP/1.0
Connection: close
Content-Type: application/xml; charset="utf-8"
Depth: 0
Content-Length: 162
User-Agent: CardDAV-Sync (Android) (like iOS/5.0.1 (9A405) dataaccessd/1.0) gzip
Authorization: Basic YXdpbGxpYW06OmZyZWQxMg==
Accept-Encoding: gzip

<?xml version="1.0" encoding="utf-8" ?>
<A:propfind xmlns:B="urn:ietf:params:xml:ns:carddav" xmlns:A="DAV:">
    <A:prop>
        <B:addressbook-home-set/>
    </A:prop>
</A:propfind>

Response

HTTP/1.0 207 Multistatus
Server: BaseHTTP/0.3 Python/2.7.3
Date: Tue, 27 Nov 2012 23:30:07 GMT
Content-Length: 530
Content-Type: text/xml; charset="utf-8"
X-Dav-Error: 200 No error
Ms-Author-Via: DAV

<?xml version="1.0" encoding="utf-8"?>
<D:multistatus xmlns:G="http://groupdav.org/" xmlns:E="urn:ietf:params:xml:ns:carddav" xmlns:D="DAV:" xmlns:C="urn:ietf:params:xml:ns:caldav" xmlns:B="http://icewarp.com/ns/" xmlns:A="http://apache.org/dav/props/">
  <D:response>
    <D:href>/dav/Contacts/</D:href>
    <D:propstat>
      <D:status>HTTP/1.1 200 OK</D:status>
      <D:prop>
        <E:addressbook-home-set><D:href>/dav/Contacts</D:href></E:addressbook-home-set>
      </D:prop>
    </D:propstat>
  </D:response>
</D:multistatus>

Request

PROPFIND /dav/Contacts/ HTTP/1.0
Host: coils.wmmi.net
Connection: close
Content-Type: application/xml; charset="utf-8"
Depth: 1
Content-Length: 129
User-Agent: CardDAV-Sync (Android) (like iOS/5.0.1 (9A405) dataaccessd/1.0) gzip
Authorization: Basic YXdpbGxpYW06ZnJlZDEy
Accept-Encoding: gzip

<?xml version="1.0" encoding="utf-8" ?>
<A:propfind xmlns:A="DAV:">
    <A:prop>
        <A:displayname/>
        <A:resourcetype/>
    </A:prop>
</A:propfind>

Response

HTTP/1.0 207 Multistatus
Server: BaseHTTP/0.3 Python/2.7.3
Date: Tue, 27 Nov 2012 23:30:07 GMT
Content-Length: 1109
Content-Type: text/xml; charset="utf-8"
X-Dav-Error: 200 No error
Ms-Author-Via: DAV

<?xml version="1.0" encoding="utf-8"?>
<D:multistatus xmlns:G="http://groupdav.org/" xmlns:E="urn:ietf:params:xml:ns:carddav" xmlns:D="DAV:" xmlns:C="urn:ietf:params:xml:ns:caldav" xmlns:B="http://icewarp.com/ns/" xmlns:A="http://apache.org/dav/props/">
    <D:response>
        <D:href>/dav/Contacts/</D:href>
        <D:propstat>
          <D:status>HTTP/1.1 200 OK</D:status>
          <D:prop>
            <D:resourcetype><D:collection/></D:resourcetype>
            <D:displayname>Contacts</D:displayname>
          </D:prop>
        </D:propstat>
    </D:response>
    <D:response><D:href>/dav/Contacts/All/</D:href>
        <D:propstat>
          <D:status>HTTP/1.1 200 OK</D:status>
          <D:prop>
            <D:resourcetype><D:collection/><E:addressbook/></D:resourcetype>
            <D:displayname>All</D:displayname>
          </D:prop>
        </D:propstat>
    </D:response>
    <D:response><D:href>/dav/Contacts/Favorites/</D:href>
        <D:propstat>
          <D:status>HTTP/1.1 200 OK</D:status>
          <D:prop>
            <D:resourcetype><D:collection/><E:addressbook/></D:resourcetype>
            <D:displayname>Favorites</D:displayname>
          </D:prop>
        </D:propstat>
    </D:response>
</D:multistatus>

The client then displays a list of Contact folders from which to create an address book!

Payload

Example VCard

BEGIN:VCARD
VERSION:3.0
N:Smith;George;;;
ADR;TYPE=HOME:;;555 Pandora Dr;Podunk;Gr;99999;
EMAIL;TYPE=INTERNET;TYPE=HOME:george@example.net
FN:George Smith
TEL;TYPE=CELL:1 11.222.3333
PRODID:-//dmfs.org//mimedir.vcard//EN
REV:20121128T110559Z
UID:4ef1363f-0aac-4bec-ab2f-72498d74af49
END:VCARD

Related

Tickets: #70
Wiki: CardDAV
Wiki: Clients
Wiki: ServiceDiscovery
Wiki: WebDAV

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.