CallDAV和CardDAV同步

CalDAV and CardDAV are protocols to synchronize calendars and contacts with a remote server. Many email-hosters provide a CalDAV and CardDAV interface.

Note: CalDAV Sync can also be set up in using the calendar app. Open the app, click on the little calendar icon in the top right corner and select “Add internet calendar > Generic CalDAV”. Enter your calendar URL as well as your username and password to complete the process.

At the moment, there is no carddav implementation directly accessible from the Ubuntu Touch graphical user-interface, so the only way to sync carddav is by using syncevolution + cron. However, there is a simple way to do that with a script that you can run in the terminal or via phablet SSH connection. These instructions work for caldav as well.

  1. 可以借助这个 `教程 <https://docs.ubports.com/en/latest/userguide/advanceduse/adb.html>`_来启用开发者模式和ADB(或者SSH)连接。
  2. 下载这个`脚本 <https://gist.github.com/bastos77/0c47a94dd0bf3e394f879c0ff42b7839>`_ (我们将其命名为 dav.sh) 并编辑以下变量:
  • server side : CAL_URL, CONTACTS_URL, USERNAME, PASSWORD (of your ownCloud/nextCloud/baikal/SOGO/… server)
  • CONTACT and CALENDAR _ NAME / VISUAL_NAME / CONFIG_NAME (it’s more cosmetic)
  • CRON_FREQUENCY (for the frequency of synchronization)
  • 第61行:用 sudo sh -c "echo '$COMMAND_LINE' > /sbin/sogosync" , 替换``sudo echo “$COMMAND_LINE” > /sbin/sogosync``, 以避免权限不足的错误
  1. Move the file to your Ubuntu Touch device, either by file manager or with adb:

    adb push dav.sh /home/phablet
    
  2. 将手机连接至shell (adb shell)或者直接使用手机端的终端,并输入以下内容:

    chmod +x dav.sh
    ./dav.sh