![Simbiotic - A Cyberpunk Thriller Novel](images/simbiotic-9.jpg)
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
- B. Prepare GNU/Linux Computer
- C. Set Up Radicale Server
- D. Set Up Desktop Calendar and Contact
Applications
- E. Set Up Android
- Conclusion
- References
- Future Articles
- Appendix A: Set Up Android with old DAVdroid app
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.
- Start J-Pilot with K -> Office -> J-Pilot.
- Select addresses with View -> Addresses.
- Select menu File -> Export.
- Ensure All addresses selected near top of dialog.
- Choose vCard (Optimized for Gmail/Android import)
- Enter jpilot-contacts-Android.vcf as filename.
- Click OK.
- 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.
- Start J-Pilot with K -> Office -> J-Pilot.
- Select calendar events with View -> Datebook.
- Select menu File -> Export.
- Choose iCalendar
- Enter jpilot-calendar.ics as filename.
- Click OK.
- 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 |
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.
- Install openssl.
sudo apt-get update
sudo apt-get install openssl
- 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.
- 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.
- 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.
- 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.
- Install the git package.
sudo apt-get install git-core
- Install the dulwich package for git versioning support.
sudo apt-get install python-dulwich
On my system this installed an extra package: python-fastimport
- 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.
- 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.
- 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.
- Install the package containing the htpasswd
command.
sudo apt-get install apache2-utils
- 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.
- Modify Default Radicale Configuration.
- Edit the /etc/radicale/config configuration
file.
sudo kate /etc/radicale/config
- 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.
- 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
- 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
- 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
- Save the /etc/radicale/config file and exit the
editor.
- Edit the /etc/radicale/config configuration
file.
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.
- 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.
- 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? 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
Remember to substitute your own USERID in the following steps. The trailing slash "/" is important.
$ cadaver
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.
- Start K -> Office -> Kontact.
- Wait a short while for mouse cursor to return to normal arrow.
- 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. - 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.
- Start K -> Settings -> System Setting.
- Under Network and Connectivity section, double-click SSL Preferences.
- Click Add...
- Clear out Filter: so it is empty.
By default it contains DER/PEF/Netscape-encoded X.590 certificate. - Select the certificate:
Select Name: ~/addrcal-cert.pem
- Click Open.
- Click Apply.
- 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.
- Start K -> Office -> KOrganizer
- Choose Settings -> Configure KOrganizer...
- Select General on left-hand-side (should already be selected)
- Select Calendars tab
- Click Add...
- Select DAV groupware resource
- Click OK
- Fill in the Login Credentials you previous
created for the address and calendar user.
I used the same credentials as my kubuntu userid and password.User: userid Password: password
- Click Next
- For Groupware Server, select Configure the resource manually
- Click Finish
- If KDE Wallet Service window pops up, provide
a password.
I used my kubuntu login password.
Password: password Verify: password
- Click Create
- On General configuration, fill in
the Display name
Display name: caldav-myaddrcal Refresh every: *5* minutes Username: <already filled in> Password: <already filled in>
- Click Add
- For Remote calendar access protocal select CalDAV
- 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/
- Click Fetch
- Select the calendar.ics entry under Display name
- Click OK to close DAV groupware resource...
- Click OK to close DAV groupware resource
- Click OK to close Configure - KOrganizer
- Close KOrganizer
This is needed to recognize the new DAV groupware resource we created.
- Start K -> Office -> KOrganizer
- On lower left portion of window, enable caldav-myaddrcal -> calendar.ics
- [Optional] If you do not have local calendar
entries, you can avoid future confusion by removing Personal
Calendar
- On lower left portion of window, right-click
on Personal Calendar and choose Delete
calendar
- At prompt Do you really want to delete
Personal Calendar?, click Delete
- On lower left portion of window, right-click
on Personal Calendar and choose Delete
calendar
- [Optional] Set up holidays.
- Choose KOrganizer -> Settings -> Configure KOrganizer...
- Click Time and Date on Left-hand-side.
- Under Holidays section:
Use holiday region: Canada (British English)
- Click OK.
- 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.
- Start K -> Office -> KOrganizer
- Choose File -> Import -> Import Calendar...
- Select the iCalendar export file you created earlier.
(For example jpilot-calendar.ics) - Click Open
- Select Merge into existing calendar
- Click OK
- Expand caldav-myaddrcal
- Select calendar.ics
- Click OK
- Close KOrganizer
TIP: Some Calendar Events on Wrong Day or Time?
|
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.
- Start K -> Office -> KAddressBook
- Choose File -> New -> Add Address Book...
- Choose DAV groupware resource
- Click OK
- Fill in the Login Credentials you previous
created for the address and calendar user.
User: userid Password: password
- Click Next
- For Groupware Server, select Configure the resource manually
- Click Finish
- If KDE Wallet Service window pops up,
provide a password.
I used my kubuntu login password.
Password: password Verify: password
Click Create - On General configuration, fill in
the Display name
Display name: carddav-myaddrcal Refresh every: *5* minutes Username: <already filled in> Password: <already filled in>
- Click Add
- For Remote calendar access protocal select CardDAV (not CalDAV)
- 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/
- Click Fetch
- Select the contacts.vcf entry under Display name
- Click OK to close DAV groupware resource...
- Click OK to close DAV groupware resource
- Close KAddressBook
This is needed to recognize the new DAV groupware resource we created.
- Start K -> Office -> KAddressBook
- Click the greater than sign next to carddav-myaddrcal to show the hidden entry contacts.vcf
- Enable contacts.vcf
- [Optional] If you do not have local contacts, you
can avoid future confusion by removing Personal Contacts
- On left-hand-side Address Books pane, right-click on Personal Contacts and select Delete Address Book
- At prompt Do you really want to delete this addressbook?, click Delete
- 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.
- Start K -> Office -> KAddressBook
- Choose File -> Import -> Import vCard...
- Clear out Filter (by default
says vCards)
The filter prevents us from seeing the file we exported earlier.
- Select the vCard export file you create earlier.
(For example jpilot-contacts-Android.vcf)
- Click Open
- Expand carddav-myaddrcal
- Select contacts.vcf
- Click OK
- 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.
- 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.
- Transfer the addrcal-cert.crt file to your Android
device.
You might use one of the following options:
- EITHER: Transfer addrcal-cert.crt to /storage/sdcard0/
using manual file transfer.
See Setting up Android 10 - Setup Manual File Copy.
- OR: Transfer addrcal-cert.crt using adb push.
Note that 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.
- EITHER: Transfer addrcal-cert.crt to /storage/sdcard0/
using manual file transfer.
- On your Android device.
- Go to Settings -> Security -> Encryption &
credentials -> Install from SD card
Note that some scrolling may be required. - Choose three horizontal lines icon.
- Under Open from choose your-device-name to get access to all files. My device name is CGMotoGFast.
- Find addrcal-cert.crt and choose it.
- At Re-enter your PIN enter your PIN.
- At Name the certificate
enter "your-linux-hostname".
To lookup hostname on linux usehostname
command. Alternatively use "MyAddrCalCert". - Choose OK.
- Go to Settings -> Security -> Encryption &
credentials -> Install from SD card
NOTE: Certificate File |
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.
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.
- Open DAVx5.
- Use arrow right icon to navigate through screens.
- At Tasks support screen choose I don't need tasks support and choose arrow right icon.
- At Permissions choose All of the below.
- At Allow DAVx5 to access your contacts choose Allow.
- At Allow DAVx5 to access your calendar choose Allow.
- Choose arrow right icon.
- At Regular sync intervals screen enable Regular sync intervals.
- At Let app always run in background? choose Allow.
- Choose arrow right icon.
- At Open-source software choose Don't show in the near future (do consider donating to project).
- Choose checkmark icon.
- At Welcome to DAVx5 screen choose + icon.
- Choose Login with URL and user name and fill
in the fields:
Be sure to use your calendar and contact server IP address.Base URL: https://192.168.1.54:5232 User name: your-userid Password: your-password
- Choose Login.
- 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.
- At Add account - Create account screen for Contact group method choose Groups are per-contact categories.
- Choose Create Account.
- At your-userid screen on CARDDAV tab enable contacts.vcf.
- Choose CALDAV tab and enable calendar.ics.
- Choose two arc arrows icon in lower right.
Should display synchronizing now. - Exit app.
E.4. Configure Contacts Android Application
Following are the steps to configure Contacts to list contacts by last name first.
- Open Contacts.
- At Contacts - Back up & organize your contacts with Google choose Skip.
- At Search contacts - No contacts in this account screen choose phone? icon in upper right.
- In list of accounts screen choose Contacts from
all accounts.
Should display list of contacts. - Choose three horizontal lines icon in upper left and choose Settings.
- Choose Sort by and choose Surname.
- Choose Name format and choose Surname first.
- Choose Default account for new contacts and choose DAVx5 Address book.
- Exit app.
E.5. Configure Calendar Android Application
Following are the steps to configure Calendar to not use a Google account.
- Open Calendar.
- At Google Calendar screen choose right arrow icon.
- At Easy to scan and lovely to look at screen choose right arrow icon.
- At Events from Gmail choose Got it.
- 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.
- Open Settings.
- Choose Sound.
- Set the various volumes to your preference.
- 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:
- Radicale - CalDAV and CardDAV Server
- DAVdroid - What is DAVdroid?
- Radicale and DAVDroid
- CalDAV and CardDAV with Radicale and DAVdroid on Android
- J-Pilot
- F-Droid
Future Articles
In future articles, I plan to cover the following topics:
- Migrating Palm OS Memos to Android
- Migrating Palm OS Keyring to Android (hint: use KeePassX and KeePassDroid)
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.
- 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.
- 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.
- On your Android device.
- Go to Settings -> Security -> Install from
SD card
Note that some scrolling is required. - Under Internal storage scroll down and tap on addrcal-cert.crt
- At Certificate name prompt, enter MyAddrCalCert
- Click OK
- Go to Settings -> Security -> Install from
SD card
NOTE: Certificate File |
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.
- 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.
- On Android, got to Settings
- Scroll down to Accounts and select + Add account
- Select DAVdroid
- Select Login with URL and user name
- Select -> (right arrow)
- Fill in the fields:
https:// 192.168.1.53:5232 User name: userid Password: password enable: Premptive authentication
- Select -> (right arrow)
- Select/enable address books and calendars
Address books: contacts.vcf # enable Calendars: calendar.ics # enable
- Select -> (right arrow)
- Fill in account details:
Account name: userid@homeserver
The name "homeserver" is the hostname of your GNU/Linux computer. - Select v (check mark) in upper right-hand corner.
- Close Settings
TIP: Manually Invoke DAVdroid Synchronization
|
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.
- Start People.
- Click ... in lower right-hand-side.
- Click Settings.
- Tap Sort list by.
- Choose Family name.
- Tap View contact names.
- Choose Family name first.
- Back out of Settings.
E.5. Configure Calendar Android Application
Following are the steps to configure Calendar to use the home time zone.
- Start Calendar.
- Click ... in upper right-hand-side.
- Click Settings.
- Click General Settings.
- Enable Use home time zone.
- Scroll down to Notifications & Reminders.
- Set Notifications, Sound, Vibrate, and Pop-up notification to your preference.
- Back out of Settings.
E.6. Configure Android Volume Settings
Following are the steps to change the volume settings in Android.
- On Android, got to Settings
- Under Device and select Sound
- Tap Volumes
- Set the various volumes to your preference.
- Tap OK
- 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.
- 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
- Start Silent Night on phone.
- Set Start time and End time for the range of hours you do not wish to be disturbed.
- Enable silent night.
- Back out of the application.
![The Medusa Deception novel - free first in series](images/medusa-deception-promo.jpg)