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:
- 1: Introduction
- 2: ownCloud
- 3: Getting rid of unwanted bloatware
- 4: App Replacements
- 5: Free your Droid!
- 5a: microG (update to NOGAPPS in part 5)
- 6: Self-Experiment (still running)
- 7: Where do I get my apps now?
Started before this series, but clearly belonging here:
Index of this article
- What does ownCloud offer?
- Installing ownCloud
- Exporting calendar and contact from Android, and importing to ownCloud
- Setting up Android
- 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:
- files: FolderSync
- calendar: DavDroid, CalDAV-Sync
- contacts: DavDroid, CardDAV-Sync
- documents, pictures: special views on “files”, even with special viewers/editors for different formats
- tasks: is currently absent, but coming back with one of the next versions. As saved in the calendar, most likely the apps listed for that cover it.
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.
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 http://download.opensuse.org/repositories/isv:/ownCloud:/community/xUbuntu_12.04/ /" >> /etc/apt/sources.list.d/owncloud.list wget http://download.opensuse.org/repositories/isv:ownCloud:community/xUbuntu_12.04/Release.key 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
"dbhost" => "127.0.0.1", // 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
- ownCloud Apps server: most apps are available here. But not all.
- owncloud-markdown: adds Markdown support to OC editor. With folding support!
- oclife: hierarchical tags
- owncloud-youtubedl: Youtube downloader
- ownPrey: Prey control panel (Prey Anti Theft?)
- files_tree: add a directory tree to OC’s file browser
- Youtube Video: Owncloud 4 Tutorial #12 - Designs wechseln mit dem Themes Manager
Not yet supported, but hopefully soon:
- wallabag: self-hosted "ReadItLater" with Android client, plugins for e.g. Firefox & Chrome, and more
Additional links on customizing/tuning/enhancing ownCloud
- OwnCloud: Open-Source-Dropbox-Alternative auf eigenem Server (T3N 7/2012)
- ownCloud Performance steigern (PDF; 11/2013)
- Slow Admin-Page (4/2014)
- Eigenen Firefox-Sync-Server mit ownCloud nutzen (10/2013)
- ownCloud mit eigenem Branding (9/2013)
- multiple ownCloud Artikel at FinnChristiansen.de
Exporting calendar and contact from Android, and importing to ownCloud
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
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
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.:
- Sync your call-logs and SMS with a specific calendar: Call Log Calendar, Call Calendar
- Access your ownCloud bookmarks: ownCloud Bookmarks
- instantly sync photos/videos right after they’ve been taken: OwnCloud Client, ownCloud, Instantii
- News (RSS): ownCloud News Reader
- Tasks/Todo: Task Sync
- Notes: My Own Notes, MortNotes
Further helpful links
- ownCloud and Android
- Owncloud 6 Synchronisation Tutorial (12/2013)
- OwnCloud Kontakte, Termine und Aufgaben mit Android synchronisieren (4/2014; complete tutorial, German)
- Autonomie der eigenen Daten: Owncloud (8/2013; German tutorial: contacts, calendar, file-sync)
- Android: Kontakte und Kalender über Owncloud synchronisieren (8/2013; German)
- Marrying ownCloud to Android (12/2013)
- topping it: Mit dem eigenen (VPS/Root-)Server weg von Google: Centos 6.5 + Kolab 3.2 + Owncloud 6 + Plex (4/2014, Kolab integrates mail, ownCloud, and more)
- Alternatives to ownCloud
- Seafile (also see Heise and Raspberry Pi: Owncloud-Alternative Seafile Server installieren4) for files
- Baïkal: CalDAV + CardDAV lightweight server for contacts & calendar
idea taken from Stack Exchange: Certificate Install without mandatory PIN lockscreen ↩︎
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
/system/etc/security/, find matching instructions in the CAcert Wiki. ↩︎