Mastodon IzzyOnDroid

Say thanks!
Privacy Links
↓ Your product here? ↓
Das Inoffizielle Android-HandbuchAndroid kennenlernen, Tipps & TricksDas Inoffizielle Android-Handbuch
Android kennenlernen, Tipps & Tricks
Buy at Amazon for EUR 16,99
Das Inoffizielle Android SystemhandbuchTiefer ins System einsteigenDas Inoffizielle Android Systemhandbuch
Tiefer ins System einsteigen
Buy at Amazon for EUR 7,00
Die besten Android-AppsDen Androiden austattenDie besten Android-Apps
Den Androiden austatten
Buy at Amazon for EUR 5,00

Android without Google 2: ownCloud

OwnCloud 6.0.3 Web Interface
OwnCloud 6 Web Interface; © Wakeup12 (CC-BY-SA); Source: Wikimedia

In the previous article I’ve outline some reasons driving me away from Google, and wanting to “free my Android”. As you’re reading this article, you probably share some of my concerns.

To completely rid Android of all Google services, it takes a lot – as usually they come pre-installed on almost all devices. So one had not only to root the device, but also to install a Custom ROM without the Google apps. Which means not only getting rid of some “nasty elements”, but also: no Gmail, no Playstore. Most of you probably don’t want to go that far. Or if you at least consider it, you want to know before what alternatives are available.

So do I. And thus my focus was to start with solutions covering as many aspects at once, while being put-to-use with as few as possible steps. Best without tasks being “too technical”, and avoiding “root voodoo” wherever possible (I hope I succeeded with that). This lead me to my first candidate: ownCloud.

Android without Google:

Started before this series, but clearly belonging here:

Index of this article

  1. What does ownCloud offer?
  2. Installing ownCloud
  3. Exporting calendar and contact from Android, and importing to ownCloud
  4. Setting up Android
  5. Further helpful links

What does ownCloud offer?

The left-menu bar in the picture at the right already indicates several of the features ownCloud ships with by default. The (incomplete) list here will name some Android counterparts (also incomplete) they can sync with:

While far from being the complete list of “ownCloud apps” available (more on that further down), it already covers most of our sensitive data: contacts, calendar events, and files. And as using this product (plus disabling the corresponding Google counterparts) can easily be done without Custom Rom or root, I think it’s a good point to start with.

Installing ownCloud

ownCloud can be installed on a multitude of devices. During my recherche, I’ve seen it mentioned running on Raspberry Pi, Fritz!Box, and all kind of computers running different operating systems. I cannot test them all. But I’ve tested it on one of my Ubuntu machines. So here I describe how I installed ownCloud on Ubuntu 12.04. You can find instructions for other installations on the ownCloud install page.

echo "deb /" >> /etc/apt/sources.list.d/owncloud.list
apt-key add - < Release.key
apt-get update
apt-get install owncloud

# Ubuntu 12.04: /etc/apache2/conf.d/owncloud.conf needs:
#  php_flag magic_quotes_gpc off

That’s all – install completed! Of course, if you want to you can fine-tune things a little. But basically, after the finalizing service apache2 reload, you can call up the wizard via your web browser and start using your ownCloud instance. Some tweaks to speed up the whole thing can be applied in /var/www/owncloud/config/config.php by adding elements to the $CONFIG array:

"dbhost" => "", // when using MySQL on localhost. Avoids name resolution, hence faster
"appstoreenabled" => false, // by default this is TRUE, so calling up the apps page takes ages

// once you’ve confirmed everything is working fine, you can disable some checks:
"check_for_working_webdav" => false,
"check_for_working_htaccess" => false,

// if you plan to manually install additional ownCloud apps, make sure to:
"appcodechecker" => true,

Additional Apps to extend ownCloud

Not yet supported, but hopefully soon:

Exporting calendar and contact from Android, and importing to ownCloud

ownCloud contacts Import

Export is pretty easy, and can be done with the pre-installed contacts and calendar apps. Both offer to export to SD card using a standard format (.vcf aka VCard for contacts, and .ics aka iCalendar for the calendar events), which is accepted by all kind of calendar and contact handling software. The exported files are then copied to your computer, from where you can import them into ownCloud.

The import into ownCloud I chose to do via Evolution, which has a nice import feature. The process worked flawlessly, and the items turned up in ownCloud immediately. But of course, import is also possible directly from within ownCloud: clicking the “gear” symbol at the bottom of the left pane (when in the calendar or contacts module) opens a menu, offering an “Import” feature. You can have the format auto-detected or, if that doesn’t work out, select the format manually.

Setting up Android


We certainly don’t do all those changes to have the Man in the Middle snooping out our data, sending them unencrypted. So the first step is to get our server’s certificate recognized by Android. If you run your ownCloud on a server using a certificate signed by one of the ”official CAs”, you can skip this part: Android already knows about it. If the apps you plan to use to synchronize your data deal with this themselves, you can skip it as well. But it gets a little trickier if you’re using a self-signed certificate, and the apps do not deal with it themselves – as it currently is the case with DavDroid1.

One way to make the certificate known to your device is copying the .pem file of the CA to your SD card, and then go to Settings → Security → Credential Storage, select “Install from SD card”, and import it. As a side-effect, this forces you to use a specific screen lock method (such as pattern or PIN lock). If you don’t want the one or the other, there’s a work-around involving Mr. root:2

prepare self-signed certificate for use with Android

This must be the certificate of the CA (certificate authority) used when you signed your server’s certificate. Usually it’s called cacert.pem, so I use that here:

# obtain the hash
openssl x509 -inform PEM -subject_hash_old -in cacert.pem | head -1
# prepare the cert (this exemple assumes above command returned `d12345` as hashval)
openssl x509 -inform PEM -text -fingerprint -in cacert.pem > d12345.0
# maybe optional: use a plain-text editor to move the base64 encoded
# part to the beginning of the file

install certificate on Android as “trusted CA”3

This part requires root. To give an easy example, I assume your “hash” from above was d12345. So first copy d12345.0 to your Android device’s sdcard. Mount /system read/write. Then:

# copy the file into the certificate directory:
cp d12345.0 /system/etc/security/cacerts/
# adjust permissions
cd /system/etc/security/cacerts/
chown root:root d12345.0
chmod 0644 d12345.0

Done. Now your CA should turn up as “trusted system certificate” (in Settings → Security → Credential Storage → Trusted Credentials it should be listed in the “System” tab), and thus all certificates signed with it will be accepted as “trusted”.

Synchronizing Calendar and Contacts

Add Account
Add Account

For this part I decided to use DavDroid. The app is available at the Playstore for EUR 3 – or alternatively for free at F-Droid. Beside the fact it covers calendar and contacts, it was its being Open Source bringing me to this app: it’s hosted on Github, where everybody can investigate the sources. I further chose F-Droid as installation source, as the staff checked the source code and built the .apk directly from there – another level of security. I didn’t want to replace one proprietary service with another.

Once the app is installed, we can start connecting contacts and calendars from our ownCloud installation with our Android device. DavDroid registers with the Android account service, so that’s where we need to go to. This can either be done via the Android Settings, or directly from within the DavDroid app. But though it covers both contacts and calendars, you will have to create separate accounts for each. The corresponding URLs can be found behind the “gear” symbol described above: the “chain” symbol will reveal them. Provide your credentials along, and submit your configuration – you’re done. Contacts and events should show up in the usual places, and kept in sync with your ownCloud installation.

Finally, don’t forget to adjust your contacts/calendar apps regarding their default storage (where new contacts/events should be created), and disable the calendar/contact groups you’ve moved to ownCloud ;)

Synchronizing files

FolderSync accounts

I already used FolderSync for a while (actually, I’ve bought the Pro version and use that) to keep my backups and other stuff synced between my Android devices and my computer. So I was glad to see it also supports ownCloud – even directly, though one could also use WebDAV I guess (see the screenshot to the right). FolderSync supports different types of syncs: two-way or one-way. So it can be used to keep a folder-pair (local directory plus remote directory) in sync, copying new files from either side to the other and deleting files removed on one end also from the other – or as “backup” for e.g. your photos, to just copy new ones to your ownCloud so you can free that space on your device after that.

It’s up to you to setup folder-paris and schedule their synchronization. All that can be done from within the app or, if you’ve bought the Pro version like me, triggered via Tasker, which gives you a lot of flexibility. I for example don’t want to have my sync running via mobile data. FolderSync can take care for conditions like that itself: you can even nail it to a specific WiFi. But with Tasker, I can bring in additional conditions, like making sure Titanium Backup has finished it’s job. Apart from that: even with just a single sync scheduled at 3:00 a.m., FolderSync woke up all 5 minutes to see if there was something to do – no idea why, but having told it I only sync manually, and leaving the real job to Tasker solved this as well.

Of course, there’s the official ownCloud client as well, so you might wish to give that a try. It’s available for less than a Euro at Google Play (and for free again at F-Droid). The pros may be the instant upload of photos and videos for those requiring it. You could use it instead of FolderSync – but it doesn’t integrate your calendars or contacts. At least not currently, according to the apps description.

More things to sync/access?

Basically, there are several other things you could synchronize to your ownCloud. With the right tools, you could e.g.:


  1. this might change, if the dev can be convinced ↩︎

  2. idea taken from Stack Exchange: Certificate Install without mandatory PIN lockscreen ↩︎

  3. The instructions here are for Android 4.0 (ICS aka Ice Cream Sandwich) and up. If you cannot find the directory /system/etc/security/cacerts/, but instead there’s a file named cacerts.bks in /system/etc/security/, find matching instructions in the CAcert Wiki↩︎

  4. thanks to Thomas @tuxpost for this link! ↩︎