Linux Crumbs
Simbiotic - A Cyberpunk Thriller Novel

Set Up Android Calendar and Contacts with DAVdroid/DAVx5 Sync to Radicale Server on Linux

Summary

This tutorial describes how to set up Android Calendar and Contacts to use older DAVdroid or newer DAVx5 replacement app to synchronize data with a Radicale CalDAV/CardDAV server running on GNU/Linux. The steps use Free Software, do not use or share your data with external service providers, and work with the stock "non-rooted" Android image.

The final solution enables wireless network synchronization of calendar and contact data between an Android device and a GNU/Linux computer. This is similar to how Palm OS devices could synchronize calendar and contact data over a USB cable with a GNU/Linux computer running J-Pilot.

This tutorial is the second in a series to replace my failing Palm Tungsten E2 with a device running Android. The first article titled Migrating from Palm OS to Android - The Journey Begins includes instructions on how to enable and install applications from unknown sources such as F-Droid.org.

These tutorial steps were developed using Android 4.4.4 (updated for Android 10) and Kubuntu 12.04 (Precise Pangolin) GNU/Linux. The steps should be useful for other distributions with some minor modifications. For example on Fedora replace the Debian package manager apt-get with the fedora package manager dnf or yum.

Although this tutorial is quite long, don't let that hold you back from taking control of your own data. The general approach groups steps into logical sections, trying to keep related areas together.

Update 2020-12-12: Added new "Set Up Android" section covering Android 10 and DAVx5 (newer replacement app for DAVdroid). Moved older DAVdroid instructions to Appendix A.

Update 2017-12-31: Added subsection numbering and colouring to two subsections to make sections more distinct. Note that although these instructions have not been fully updated for Kubuntu 16.04 there should still be enough surrounding information to find the proper menu locations.

Contents

A. Backup Existing Calendar and Contacts

Before you begin this tutorial, be sure to backup your existing Android and GNU/Linux calendar and contact data. This is to ensure you do not lose any data while implementing the steps in this tutorial.

By default on Android:

  Contact information can be local to the device, but
  Calendar events can not be local.

This means that what you think are local events might actually be associated with an external service provider, such as Google Calendar, Microsoft Exchange, or some other application. Deleting the associated account will delete your entire calendar from your Android device.

For Android contact information, you can export data using the "Import-Export" functionality of the stock Android Contacts application. Then later after the CardDAV account has been set up, you can re-import the contact data. Contact data is often stored in a vCard file.

For Android calendar events, you will need to learn how to perform the backup using your external service provider account. Searching for the name of your external service provider along with "export to iCalendar" should help. Calendar events are often stored in an iCalendar file.

For GNU/Linux contacts and calendars, I personally am using J-Pilot and will describe how to export the data. For other calendar and contact applications, an Internet search with the name of the software application with "export to iCalendar" or "export to vCard" can help.

A.1. Export J-Pilot Contacts

Following are the brief steps I used to export the contact information (addresses) from J-Pilot v1.8.2.

  1. Start J-Pilot with K -> Office -> J-Pilot.
  2. Select addresses with View -> Addresses.
  3. Select menu File -> Export.
  4. Ensure All addresses selected near top of dialog.
  5. Choose vCard (Optimized for Gmail/Android import)
  6. Enter jpilot-contacts-Android.vcf as filename.
  7. Click OK.
  8. Close J-Pilot.

A.2. Export J-Pilot Calendar

Following are the brief steps I used to export the contact information (datebook) from J-Pilot v1.8.2.

  1. Start J-Pilot with K -> Office -> J-Pilot.
  2. Select calendar events with View -> Datebook.
  3. Select menu File -> Export.
  4. Choose iCalendar
  5. Enter jpilot-calendar.ics as filename.
  6. Click OK.
  7. Close J-Pilot.

B. Prepare GNU/Linux Computer

In this section we will prepare our GNU/Linux computer to provide services to other computers.

TIP:   Ensure Correct Date and Time

Since your GNU/Linux computer will be providing services that depend on the correct date and time, be sure to check and set your computer to the proper date, time, and timezone.

B.1. Set Up Static IP Address

Because we will be using a GNU/Linux computer to provide calendar and contacts services to our Android device, we need to set up a static (unchanging) IP address on the computer.

Follow the instructions at How To and Why Set Up a Static IP Address on GNU/Linux.

For this tutorial I use the following static IP address:

192.168.1.53 - static IP address.

B.2. Create an SSL Self-Signed Certificate

The reason for using an SSL certificate is to ensure that all information is encrypted when it passes between the Android device and the GNU/Linux computer running the Radicale server.

  1. Install openssl.

    sudo apt-get update
    sudo apt-get install openssl

  2. Generate an SSL self-signed certificate.

    openssl req -nodes -x509 -newkey rsa:2048 -keyout addrcal-key.pem -out addrcal-cert.pem -days 36500

    The above command will prompt for information which you will need to provide for your system. In my case I entered the following:

    [...]
    Country Name (2 letter code) [AU]: CA
    State or Province Name (full name) [Some-State]: Alberta
    Locality Name (eg, city) []: Calgary
    Organization Name (eg, company) [Internet Widgits Pty Ltd]: My Addressbook and Calendar
    Organizational Unit Name (eg, section) []:
    Common Name (e.g. server FQDN or YOUR name) []: 192.168.1.53
    Email Address []: myaddrcal at example dot com

    Note the IP address is the static IP address we set up earlier.

Note that we'll need these certificate files later when configuring Radicale and DAVdroid/DAVx5.

C. Set Up Radicale Server

While there are several calendar (CalDAV) and contacts (CardDAV) servers out there, I choose Radicale because it does not require a web server, works with DAVdroid/DAVx5, and can be configured to use git version control.

C.1. Install Radicale

In the following step we install the Radicale server.

  1. Install the latest radicale packages.

    sudo apt-get install radicale

If you are using a recent GNU/Linux distro (Ubuntu 16.04 or newer) then skip to the next step to Make Radicale Use git Versioning.


Otherwise if you are using an older GNU/Linux distribution like Ubuntu 12.04, then use the following steps to update to a newer version of radicale.

When I originally wrote this tutorial the version packaged for kubuntu 12.04 was old (0.6.3-1) and did not support git version control. To address this I installed an updated package (0.10-2 at time of writing, now 1.1.1) from Debian.

  1. Download newer Radical packages.

    Visit https://packages.debian.org/stretch/radicale

    Scroll down, click on all link and then select a download mirror.

    These actions should download the radicale_0.10-2_all.deb package file.

    Similarly, visit https://packages.debian.org/stretch/python-radicale

    Scroll down, click on all link and then select a download mirror.

    These actions should download the python-radicale_0.10-2_all.deb package file.

  2. Install the newer Radicale packages overtop the prior version.

    sudo dpkg -i ~/Downloads/radicale_0.10-2_all.deb ~/Downloads/python-radicale_0.10-2_all.deb

    Note that the radicale package installs a radicale userid and group, and the ability to auto-start the radicale server at boot time.

C.2. Make Radicale Use git Versioning

The key feature of using git version control is that it tracks all changes to calendar events and contact information. Using this history, a person can view all changes to the data and can roll back individual changes using native git tools, if needed. Hence if data is accidentally deleted, it can be recovered.

  1. Install the git package.

    sudo apt-get install git-core

  2. Install the dulwich package for git versioning support.

    sudo apt-get install python-dulwich

    On my system this installed an extra package: python-fastimport

  3. Configure git, which is required for next step.

    git config --global user.name "your name"
    git config --global user.email "your email address"

    Use your name and email address in the above commands.

  4. Initialize the radicale collections as a git repository.

    NOTE:   Calendar and Contacts Collections Storage

    The location where calendar and contact information is stored is defined by the filesystem_folder setting under the [storage] section of the /etc/radicale/config file.

    The default storage location is the /var/lib/radicale/collections folder.

    You can change this value. If you do, then be sure to use the new value in subsequent tutorial steps.

    If you are the only user on the computer, you might prefer to store the information under your home directory. Additionally, you might also prefer to run the radicale server under your own userid, instead of the radicale userid.

    Following are some tips from Vincent Rubiolo if you wish to run Radicale under your own userid:
    Be sure to edit /etc/init.d/radicale and change DAEMON_{UID,GID} from radicale to your own UID and GID.
    Also ensure proper ownership and permissions to be able to write to /var/log/radicale/radicale.log under your userid. One way to do this is to remove /var/log/radicale directory so that it will be created on the next boot and radicale startup.

    
        sudo bash          # Run a shell as 'root'
        mkdir -p /var/lib/radicale/collections
        cd /var/lib/radicale/collections
        git init
        chown -R radicale.radicale /var/lib/radicale
        exit               # Exit 'root' shell
        

C.3. Install SSL Certificate on Radicale

In order to ensure encrypted communication for our calendar and contacts, the SSL certificate must be installed on both devices. Here we install the certificate for the Radicale server. For security reasons we ensure that only the radicale user (and root) can read the SSL certificates.

  1. Install certificate on Radicale.
    
        sudo bash          # Run a shell as 'root'
        mkdir /etc/radicale/certs
        cp -p addrcal-key.pem  /etc/radicale/certs/addrcal.key
        cp -p addrcal-cert.pem /etc/radicale/certs/addrcal.crt
        chown -R radicale.radicale /etc/radicale/certs
        chmod 0600 /etc/radicale/certs/*
        exit               # Exit 'root' shell
        

C.4. Configure Radicale

Now that the Radicale software is installed, the next step is to make some configuration changes to the defaults to support using usernames and passwords and SSL encryption. For passwords I chose to use apache web server style httpasswd passwords.

  1. Install the package containing the htpasswd command.

    sudo apt-get install apache2-utils

  2. Create the userid for the calendar and contacts.

    sudo htpasswd -c -s /etc/radicale/users USERID

    For simplicity I chose the same USERID and PASSWORD as my kubuntu user account.
    The -c option creates the file (only needed once).
    The -s option indicates to use SHA encryption for passwords.

  3. Modify Default Radicale Configuration.

    1. Edit the /etc/radicale/config configuration file.

      sudo kate /etc/radicale/config

    2. Set the server name / IP address.

      Under [server] set:

      hosts = 192.168.1.53:5232

      Note that 192.168.1.53 is the static IP address we set up earlier.
      The value 5232 is the port number for the calendar and contacts service.

    3. Enable Secure Sockets Layer (SSL).

      Under [server] set:

      # SSL flag, enable HTTPS protocol
      ssl = True

      # SSL certificate path
      certificate = /etc/radicale/certs/addrcal.crt

      # SSL private key
      key = /etc/radicale/certs/addrcal.key

      # SSL Protocol used. See python's ssl module for available values
      protocol = PROTOCOL_SSLv23

    4. Enable htpasswd authentication.

      Under [auth] section set:

      # Authentication method
      # Value: None | htpasswd | IMAP | LDAP | PAM | courier | http | remote_user | custom
      type = htpasswd

      # Custom authentication handler
      #custom_handler =

      # Htpasswd filename
      htpasswd_filename = /etc/radicale/users

      # Htpasswd encryption method
      # Value: plain | sha1 | ssha | crypt
      htpasswd_encryption = sha1

    5. Ensure owner only has read and write privileges.

      Under [rights] section set:

      # Rights backend
      # Value: None | authenticated | owner_only | owner_write | from_file | custom
      type = owner_only

    6. Save the /etc/radicale/config file and exit the editor.

C.5. Enable Radicale Auto-start

By default the Radicale calendar and contacts server does not automatically start when the computer boots. For the Radicale server to be available each time the computer powers up we need to perform the following steps.

  1. Enable radicale auto-start.

    Edit /etc/default/radicale file.

    sudo kate /etc/default/radicale

    Remove comment symbol # to enable auto-start.

    Change:

    # ENABLE_RADICALE=yes

    To:

    ENABLE_RADICALE=yes

    Save the /etc/default/radicale file and exit the editor.

  2. Start radicale.

    sudo /etc/init.d/radicale start

    When radicale is running, this new calendar and contacts server should be visible as:

    https://192.168.1.53:5232

    Note that both the IP address and 5232 port are configurable in the /etc/radicale/config file.

C.6. Enable Calendar and Contacts Backup

Be sure to add the collections directory, containing your calendar and contacts, to your regular backups. The collections directory is:

/var/lib/radicale/collections

If you run your backups under your normal userid then you will need to add your userid to the radicale group so that your userid has access to the directory. This can be done with the following command:

sudo usermod -a -G radicale USERID

Use the USERID that you use to log into your computer.

D. Set Up Desktop Calendar and Contact Applications

In this section we set up calendar and contact applications for use with the GNU/Linux desktop. Since I use the Kubuntu distribution, which uses the K Desktop Environment (KDE), I chose to set up KOrganizer and KAddressbook.

If you use a different GNU/Linux desktop, or would prefer to use different applications on the desktop for your calendar and contacts, then see the CalDAV and CardDAV Clients tested with Radicale for instructions on configuring different applications.

NOTE:   No Desire To Set Up Desktop Calendar and Contact Applications?

If you do not wish to import calendar or contacts into calendar and contact applications on the GNU/Linux desktop, then at a minimum you must pre-create empty calendar and contact entries so that the Android DAVdroid/DAVx5 application can automatically detect the calendar and contacts.

The following steps to create empty calendar and contacts are needed only if you do not choose to set up desktop calendar and contact applications. The shell prompts ("$ " and "dav:/> ") are included in the following sample and the text you enter is in bold.

$ sudo apt-get install cadaver

$ cat <<EOT > /tmp/empty.ics
BEGIN:VCALENDARbr> VERSION:2.0
END:VCALENDAR
EOT
$ cat <<EOT > /tmp/empty.vcf
BEGIN:VCARD
VERSION:2.1
END:VCARD
EOT
$

Remember to substitute your own USERID in the following steps. The trailing slash "/" is important.

$ cadaver
dav:!> open https://192.168.1.53:5232/USERID/contacts.vcf/
WARNING: Untrusted server certificate presented for `192.168.1.53':
[...]
Do you wish to accept the certificate? (y/n) y
Authentication required for Radicale - Password Required on server `192.168.1.53':
Username: USERID
Password: PASSWORD
dav:/> put /tmp/empty.vcf
dav:/> cd ../calendar.ics/
dav:/> put /tmp/empty.ics
dav:/> exit
Connection to `192.168.1.53' closed.
$

If you are not configuring any desktop calendar or contact applications then you can skip ahead to Install DAVx5 on Android Device.

D.1. Configure Kontact Full Name

In KDE we need to ensure the Kontact Personal Information Manager has your name. Note that I do not use KMail so I provided Kontact with neither an e-mail address nor a password.

  1. Start K -> Office -> Kontact.
  2. Wait a short while for mouse cursor to return to normal arrow.
  3. If Account Assistant window pops up, fill out fields as follows:
    
             Full Name:  Your Name
        E-mail address:  <empty>
              Password:  <empty>
               disable:  Find provider settings on the Internet
        

    Click Cancel.
  4. Close Kontact.

D.2. Install SSL Certificate on K Desktop Environment (KDE)

In order for each KDE application to use SSL encrypted communications, the SSL certificate must be installed on KDE.

  1. Start K -> Settings -> System Setting.
  2. Under Network and Connectivity section, double-click SSL Preferences.
  3. Click Add...
  4. Clear out Filter: so it is empty.
    By default it contains DER/PEF/Netscape-encoded X.590 certificate.
  5. Select the certificate:

    Select Name: ~/addrcal-cert.pem
  6. Click Open.
  7. Click Apply.
  8. Close System Settings window.

D.3. Configure KOrganizer

This section in a different background color to help distinguish from similar instructions in another section.

KOrganizer is the KDE application for handling calendar events. By default it uses a local calendar. In these steps we configure KOrganizer to use the calendar service provided by our local Radicale server.

  1. Start K -> Office -> KOrganizer
  2. Choose Settings -> Configure KOrganizer...
  3. Select General on left-hand-side (should already be selected)
  4. Select Calendars tab
  5. Click Add...
  6. Select DAV groupware resource
  7. Click OK
  8. Fill in the Login Credentials you previous created for the address and calendar user.
    
            User:  userid
        Password:  password
        
    I used the same credentials as my kubuntu userid and password.
  9. Click Next
  10. For Groupware Server, select Configure the resource manually
  11. Click Finish
  12. If KDE Wallet Service window pops up, provide a password.
    I used my kubuntu login password.
    
        Password:  password
          Verify:  password
        
  13. Click Create
  14. On General configuration, fill in the Display name
    
         Display name:  caldav-myaddrcal
        Refresh every:  *5* minutes
             Username:  <already filled in>
             Password:  <already filled in>
        
  15. Click Add
  16. For Remote calendar access protocal select CalDAV
  17. For Remote URL be sure to use your computer IP address (the same you used when creating the SSL certificate) along with port number 5232. The trailing slash "/" is important:

    Remote URL: https://192.168.1.53:5232/USERID/calendar.ics/
  18. Click Fetch
  19. Select the calendar.ics entry under Display name
  20. Click OK to close DAV groupware resource...
  21. Click OK to close DAV groupware resource
  22. Click OK to close Configure - KOrganizer
  23. Close KOrganizer

    This is needed to recognize the new DAV groupware resource we created.


  24. Start K -> Office -> KOrganizer
  25. On lower left portion of window, enable caldav-myaddrcal -> calendar.ics
  26. [Optional] If you do not have local calendar entries, you can avoid future confusion by removing Personal Calendar

    1. On lower left portion of window, right-click on Personal Calendar and choose Delete calendar
    2. At prompt Do you really want to delete Personal Calendar?, click Delete
  27. [Optional] Set up holidays.

    1. Choose KOrganizer -> Settings -> Configure KOrganizer...
    2. Click Time and Date on Left-hand-side.
    3. Under Holidays section:

      Use holiday region: Canada (British English)
    4. Click OK.
  28. Close KOrganizer

D.4. Import Calendar Events into KOrganizer

Now that the desktop calendar application is set up, we can import the calendar events that we backed up earlier. If you don't have a backup, you can create new calendar events at this time.

  1. Start K -> Office -> KOrganizer
  2. Choose File -> Import -> Import Calendar...
  3. Select the iCalendar export file you created earlier.
    (For example jpilot-calendar.ics)
  4. Click Open
  5. Select Merge into existing calendar
  6. Click OK
  7. Expand caldav-myaddrcal
  8. Select calendar.ics
  9. Click OK
  10. Close KOrganizer

TIP:   Some Calendar Events on Wrong Day or Time?

After I imported my calendar events, I later noticed in the Android Calendar that some were displayed on the wrong day and at the wrong time. This appeared only on repeating timed events.

This problem did not occur for untimed events or single timed events.

To fix this problem for an timed event:

  1. Start Calendar on Android.
  2. Locate the event on the wrong day or time.
  3. Click on the event.
  4. Click the pencil icon in the upper right-hand corner to edit the event.
  5. Change the event time zone from Greenwich Mean Time GTM+0 to your time zone (in my case Mountain Standard Time GMT-7).

    You will likely need to set the FROM or TO times as well.
  6. Click Done in the upper right-hand corner.
  7. Repeat for all wrong day or time events.

D.5. Configure KAddressBook

This section in a different background color to help distinguish from similar instructions in another section.

KAddressBook is the KDE application for handling contact information. By default it uses local contacts. In these steps we configure KAddressBook to use the contacts service provided by our local Radicale server.

  1. Start K -> Office -> KAddressBook
  2. Choose File -> New -> Add Address Book...
  3. Choose DAV groupware resource
  4. Click OK
  5. Fill in the Login Credentials you previous created for the address and calendar user.
    
            User:  userid
        Password:  password
        
  6. Click Next
  7. For Groupware Server, select Configure the resource manually
  8. Click Finish
  9. If KDE Wallet Service window pops up, provide a password.
    I used my kubuntu login password.
    
        Password:  password
          Verify:  password
        

    Click Create
  10. On General configuration, fill in the Display name
    
         Display name:  carddav-myaddrcal
        Refresh every:  *5* minutes
             Username:  <already filled in>
             Password:  <already filled in>
        
  11. Click Add
  12. For Remote calendar access protocal select CardDAV (not CalDAV)
  13. For Remote URL be sure to use your computer IP address (the same you used when creating the SSL certificate) along with port number 5232 and your USERID:

    Remote URL: https://192.168.1.53:5232/USERID/contacts.vcf/
  14. Click Fetch
  15. Select the contacts.vcf entry under Display name
  16. Click OK to close DAV groupware resource...
  17. Click OK to close DAV groupware resource
  18. Close KAddressBook

    This is needed to recognize the new DAV groupware resource we created.


  19. Start K -> Office -> KAddressBook
  20. Click the greater than sign next to carddav-myaddrcal to show the hidden entry contacts.vcf
  21. Enable contacts.vcf
  22. [Optional] If you do not have local contacts, you can avoid future confusion by removing Personal Contacts

    1. On left-hand-side Address Books pane, right-click on Personal Contacts and select Delete Address Book
    2. At prompt Do you really want to delete this addressbook?, click Delete
  23. Close KAddressBook

D.6. Import Contact Information into KAddressBook

Now that the desktop contacts application is set up, we can import the contact information that we backed up earlier. If you don't have a backup, you can create new contacts at this time.

  1. Start K -> Office -> KAddressBook
  2. Choose File -> Import -> Import vCard...
  3. Clear out Filter (by default says vCards)
    The filter prevents us from seeing the file we exported earlier.
  4. Select the vCard export file you create earlier.
    (For example jpilot-contacts-Android.vcf)
  5. Click Open
  6. Expand carddav-myaddrcal
  7. Select contacts.vcf
  8. Click OK
  9. Close KAddressBook

E. Set Up Android

While there are a few CalDAV and CardDAV synchronization applications available for Android, I choose DAVdroid/DAVx5 because it is software that protects our user freedoms, and handles both CalDAV and CardDAV.

The following steps will prepare the SSL certificate, transfer it to the Android device, and import the certificate into Android.

Note that the certificate installation is required so that Android is able to connect and communicate with the radicale server using SSL encryption. Without the certificate Android will refuse to connect.

  1. Prepare the SSL Certificate you created earlier for use by Android.

    openssl x509 -in addrcal-cert.pem -outform DER -out addrcal-cert.crt

    Note that this is the same SSL certificate we earlier copied to the /etc/radicale/certs directory.

  2. Transfer the addrcal-cert.crt file to your Android device.

    You might use one of the following options:

  3. On your Android device.

    1. Go to Settings -> Security -> Encryption & credentials -> Install from SD card
      Note that some scrolling may be required.
    2. Choose three horizontal lines icon.
    3. Under Open from choose your-device-name to get access to all files. My device name is CGMotoGFast.
    4. Find addrcal-cert.crt and choose it.
    5. At Re-enter your PIN enter your PIN.
    6. At Name the certificate enter "your-linux-hostname".
      To lookup hostname on linux use hostname command. Alternatively use "MyAddrCalCert".
    7. Choose OK.

NOTE:   Certificate File

You can now remove the certificate file (addrcal-cert.crt) from your Android device /storage/sdcard0 directory as it is no longer required.

E.2. Install DAVx5 on Android Device

We need an application on Android to synchronize the calendar and contacts with our Radicale server. Here we use DAVx5.

A working network connection (WiFi) is needed for several of the following steps.

  1. Install DAVx5.

    The DAVx5 app is available from DAVx5.

    You can also get it at F-Droid.

E.3. Configure DAVx5

In order for the calendar and contacts to be shared with Android, we need to configure the DAVx5 contacts and calendar connections.

Note that you might see some "Network may be monitored..." messages. These can be ignored because we created and installed the self-signed certificate and hence we trust it.

Also note that when I wrote this tutorial, the following screen prompts were used. DAVx5 is actively developed and newer DAVx5 versions might use different screen prompts.

  1. Open DAVx5.
  2. Use arrow right icon to navigate through screens.
  3. At Tasks support screen choose I don't need tasks support and choose arrow right icon.
  4. At Permissions choose All of the below.
  5. At Allow DAVx5 to access your contacts choose Allow.
  6. At Allow DAVx5 to access your calendar choose Allow.
  7. Choose arrow right icon.
  8. At Regular sync intervals screen enable Regular sync intervals.
  9. At Let app always run in background? choose Allow.
  10. Choose arrow right icon.
  11. At Open-source software choose Don't show in the near future (do consider donating to project).
  12. Choose checkmark icon.
  13. At Welcome to DAVx5 screen choose + icon.
  14. Choose Login with URL and user name and fill in the fields:
    
        Base URL:   https://192.168.1.54:5232
        User name:  your-userid
        Password:   your-password
        
    Be sure to use your calendar and contact server IP address.
  15. Choose Login.
  16. At DAVx5: Connection security - DAVx5 has encountered an unknown certificate. Do you want to trust it? enable I have manually verified the whole fingerprint and choose Accept.
  17. At Add account - Create account screen for Contact group method choose Groups are per-contact categories.
  18. Choose Create Account.
  19. At your-userid screen on CARDDAV tab enable contacts.vcf.
  20. Choose CALDAV tab and enable calendar.ics.
  21. Choose two arc arrows icon in lower right.
    Should display synchronizing now.
  22. Exit app.

E.4. Configure Contacts Android Application

Following are the steps to configure Contacts to list contacts by last name first.

  1. Open Contacts.
  2. At Contacts - Back up & organize your contacts with Google choose Skip.
  3. At Search contacts - No contacts in this account screen choose phone? icon in upper right.
  4. In list of accounts screen choose Contacts from all accounts.
    Should display list of contacts.
  5. Choose three horizontal lines icon in upper left and choose Settings.
  6. Choose Sort by and choose Surname.
  7. Choose Name format and choose Surname first.
  8. Choose Default account for new contacts and choose DAVx5 Address book.
  9. Exit app.

E.5. Configure Calendar Android Application

Following are the steps to configure Calendar to not use a Google account.

  1. Open Calendar.
  2. At Google Calendar screen choose right arrow icon.
  3. At Easy to scan and lovely to look at screen choose right arrow icon.
  4. At Events from Gmail choose Got it.
  5. Exit app.

Both Contacts and Calendar should now be working with your Radicale server.

E.6. Configure Android Volume Settings

Following are the steps to change the volume settings in Android.

  1. Open Settings.
  2. Choose Sound.
  3. Set the various volumes to your preference.
  4. Back out of Settings.

Conclusion

Congratulations! You should now have calendar events and contact information synchronizing between your Android device and your GNU/Linux computer. Your data managed by you! :-)

References

While researching how to calendar and contact information on Android I found the following references useful:

Future Articles

In future articles, I plan to cover the following topics:


Appendix A: Set Up Android with old DAVdroid app

Since this tutorial was first published on Feb 9, 2015 the DAVdroid app has disappeared. Fortunately it was been replaced by DAVx5, but at time of writing (2020-12-12) only for Android 5 and higher.

The following steps describe how to set up Android with the older DAVdroid app. A link is included to the most recent DAVdroid app APK file from my Moto G2 which has Android 4.4.4.

E. Set Up Android

While there are a few CalDAV and CardDAV synchronization applications available for Android, I choose DAVdroid because it is software that protects our user freedoms, and handles both CalDAV and CardDAV.

E.1. Install SSL Certificate on Android

The following steps will prepare the SSL certificate, transfer it to the Android device, and import the certificate into Android.

Note that the certificate installation is required so that Android is able to connect and communicate with the radicale server using SSL encryption. Without the certificate Android will refuse to connect.

  1. Prepare the SSL Certificate you created earlier for use by Android.

    openssl x509 -in addrcal-cert.pem -outform DER -out addrcal-cert.crt

    Note that this is the same SSL certificate we earlier copied to the /etc/radicale/certs directory.

  2. Put the addrcal-cert.crt on the Android device.
    The trailing slash "/" is important.

    adb push addrcal-cert.crt /storage/sdcard0/

    If adb is not installed on your GNU/Linux computer, see the first article in this series: Migrating from Palm OS to Android: Installing Android Applications over USB.

  3. On your Android device.
    1. Go to Settings -> Security -> Install from SD card
      Note that some scrolling is required.
    2. Under Internal storage scroll down and tap on addrcal-cert.crt
    3. At Certificate name prompt, enter MyAddrCalCert
    4. Click OK

NOTE:   Certificate File

You can now remove the certificate file (addrcal-cert.crt) from your Android device /storage/sdcard0 directory as it is no longer required.

E.2. Install DAVdroid on Android Device

We need an application on Android to synchronize the calendar and contacts with our Radicale server. In this tutorial we use DAVdroid.

A working network connection (WiFi) is needed for several of the following steps.

  1. Install DAVdroid.

    The DAVdroid app is available from DAVdroid.

    No Google Play? See F-Droid.

    UPDATE 2020-12-12: DAVdroid seems to have disappeared from the F-Droid repository.
    For your convenience I copied the APK file of the most recent F-Droid package of DAVdroid from my phone and placed it on my DropBox account. If anyone knows of an official link to the DAVdroid APK then please let me know (my email is at the bottom of the page).

    Download DAVdroid version 1.10.1.1-ose APK (v205) package at.bitfire.davdroid_v205.apk (you don't need a Dropbox account), and

    EITHER if downloaded to phone then install using the Downloads application on your phone,

    OR if downloaded to your PC then install using the following command:

    adb install at.bitfire.davdroid_v205.apk

E.3. Configure DAVdroid

In order for the calendar and contacts to be shared with Android, we need to configure the DAVdroid contacts and calendar connections.

Note that you might see some "Network may be monitored..." messages. These can be ignored because we created and installed the self-signed certificate and hence we trust it.

Also note that when I wrote this tutorial, the following screen prompts were used. DAVdroid is actively developed and newer DAVdroid versions might use different screen prompts.

  1. On Android, got to Settings
  2. Scroll down to Accounts and select + Add account
  3. Select DAVdroid
  4. Select Login with URL and user name
  5. Select -> (right arrow)
  6. Fill in the fields:
    
          https://  192.168.1.53:5232
        User name:  userid
         Password:  password
           enable:  Premptive authentication
        
  7. Select -> (right arrow)
  8. Select/enable address books and calendars
    
        Address books:
          contacts.vcf       # enable
    
        Calendars:
          calendar.ics       # enable
        
  9. Select -> (right arrow)
  10. Fill in account details:

    Account name: userid@homeserver

    The name "homeserver" is the hostname of your GNU/Linux computer.
  11. Select v (check mark) in upper right-hand corner.
  12. Close Settings

TIP:   Manually Invoke DAVdroid Synchronization

You can manually invoke a synchronization on Android with the following steps.

  1. Open Settings
  2. Scroll down to Accounts and select DAVdroid
  3. Select ... (vertical dots) in upper right-hand corner
  4. Select Sync now
    This might take a while depending on the number of contacts and calendar events.
  5. Back out of Settings

Now is a good time to test the Android People and Calendar apps to ensure these are working. :-)

E.4. Configure People Android Application

Following are the steps to configure People to list contacts by last name first.

  1. Start People.
  2. Click ... in lower right-hand-side.
  3. Click Settings.
  4. Tap Sort list by.
  5. Choose Family name.
  6. Tap View contact names.
  7. Choose Family name first.
  8. Back out of Settings.

E.5. Configure Calendar Android Application

Following are the steps to configure Calendar to use the home time zone.

  1. Start Calendar.
  2. Click ... in upper right-hand-side.
  3. Click Settings.
  4. Click General Settings.
  5. Enable Use home time zone.
  6. Scroll down to Notifications & Reminders.
  7. Set Notifications, Sound, Vibrate, and Pop-up notification to your preference.
  8. Back out of Settings.

E.6. Configure Android Volume Settings

Following are the steps to change the volume settings in Android.

  1. On Android, got to Settings
  2. Under Device and select Sound
  3. Tap Volumes
  4. Set the various volumes to your preference.
  5. Tap OK
  6. Back out of Settings.

E.7. Install Silent Night Application [Optional]

One Android annoyance I encountered is that untimed calendar events with notifications will sound an alarm at 12:00am midnight. This alarm would disrupt my sleep. On my Palm Pilot this was not an issue because these notifications would default to sound an alarm at 8:00am.

To work around this issue, I installed Silent Night and configured it to not disturb me during my sleep hours. If your Android version is newer than KitKat then you might already have a "quiet time" feature built into the OS.

  1. Install Silent Night Android application.

    Note that Android 5 and higher include a Do Not Disturb feature which negates the need for Silent Night on such devices.
    UPDATE 2017-12-31: Silent Night seems to have disappeared from the F-Droid repository. The source code is available on github at yankovskiy/SilentNight. For your convenience I copied the F-Droid package of Silent Night from my phone and placed it on my DropBox account. If anyone knows of an official link to the Silent Night APK then please let me know (my email is at the bottom of the page).

    Download SilentNight version 0.3 APK package ru.neverdark.silentnight_v8.apk (you don't need a Dropbox account), and

    EITHER if downloaded to phone then install using the Downloads application on your phone,

    OR if downloaded to your PC then install using the following command:

    adb install ru.neverdark.silentnight_v8.apk

  2. Start Silent Night on phone.
  3. Set Start time and End time for the range of hours you do not wish to be disturbed.
  4. Enable silent night.
  5. Back out of the application.
The Medusa Deception novel - free first in series
News   Documentation     Copyright (c) 2013-2024 Curtis Gedak

Get GParted at SourceForge.net. Fast, secure and Free
	Open Source software downloads Valid HTML 4.01! Correct CSS!