Google-free android usage



All timestamps are based on your local time of:

Posted by: stak
Tags: mozilla
Posted on: 2014-10-18 22:42:19

When I switched from using a BlackBerry to an Android phone a few years ago it really irked me that the only way to keep my contacts info on the phone was to also let Google sync them into their cloud. This may not be true universally (I think some samsung phones will let you store contacts to the SD card) but it was true for phone I was using then and is true on the Nexus 4 I'm using now. It took a lot of painful digging through Android source and googling, but I successfully ended up writing a bunch of code to get around this.

I've been meaning to put up the code and post this for a while, but kept procrastinating because the code wasn't generic/pretty enough to publish. It still isn't but it's better to post it anyway in case somebody finds it useful, so that's what I'm doing.

In a nutshell, what I wrote is an Android app that includes (a) an account authenticator, (b) a contacts sync adapter and (c) a calendar sync adapter. On a stock Android phone this will allow you to create an "account" on the device and add contacts/calendar entries to it.

Note that I wrote this to interface with the way I already have my data stored, so the account creation process actually tries to validate the entered credentials against a webhost, and the the contacts sync adapter is actually a working one-way sync adapter that will download contact info from a remote server in vcard format and update the local database. The calendar sync adapter, though, is just a dummy. You're encouraged to rip out the parts that you don't want and use the rest as you see fit. It's mostly meant to be a working example of how this can be accomplished.

The net effect is that you can store contacts and calendar entries on the device so they don't get synced to Google, but you can still use the built-in contacts and calendar apps to manipulate them. This benefits from much better integration with the rest of the OS than if you were to use a third-party contacts or calendar app.

Source code is on Github: staktrace/pimple-android.

Posted by glandium at 2014-10-19 06:55:00
Awesome! I've wanted to do something like this for a while, but never found the time.
[ Reply to this ]
Posted by mat at 2014-10-19 07:07:56
Another option is to use a Google Account but deactivate the account synchronization. It's a bit buried in the settings but it's possible and it's exactly what I'm doing ; as far as Google is concerned, my account is an empty shell with no contact, calendar, mails etc.

The only drawbacks are that the account has to be created (I think), and that if you ever turn on synchronization for this account by accident or any reason, it's Game Over. Your app is obviously a safer solution.

Of course you need to use another mail/sms app to avoid GMail and Hangouts. The AOSP mail & sms app work great.
[ Reply to this ]
Posted by stak at 2014-10-19 08:43:38
I think I experimented with that and found that some seemingly-unrelated changes had the effect of turning on sync. I remember thinking it was too easy to accidentally end up in the Game Over scenario. But if it's working for you that's great to hear.
[ Reply to this ]
Posted by varun at 2014-10-19 08:40:22
I was under the impression that AOSP has/had CalDAV and CardDAV built in? Perhaps it was a function of the ROM I was using (CyanogenMod 9 or 10 maybe?), but I remember setting up contacts and the calendar syncing against 10.8 Server about two years ago when I was trying to see if I could live without a backing Google account. I do remember them yanking ActiveSync out around ICS.
[ Reply to this ]
Posted by stak at 2014-10-19 12:32:31
It may very well have those, I'm not sure. I keep my contacts in a DB with a custom schema and don't have a CardDAV service running so it wasn't really an option for me. Although that's probably not a bad way to go as long as you own the CardDAV/CalDAV boxes.
[ Reply to this ]
Posted by varun at 2014-10-19 16:11:32
One of the reasons I got sucked into Google's universe back in 2004/2005 was because syncing of contacts and calendars was so easy. I have painful memories of trying to setup a SyncML server (maybe Funambol?) back in uni to keep my various devices synced. I remember I was on the verge of buying an Exchange license because of my frustration with Java and then Google came along with this platform-agnostic syncing of contacts and calendars. I think I may have cried tears of joy when that happened. Of course, Google wasn't seen as pure evil back then.

And yeah, I own the server - it's sitting on my desk and just got Yosemited today. *pats server* Server.app 4.0 isn't too bad, but 10.10 looks to have been another stellar Apple release; should've waited until 10.10.1 :(
[ Reply to this ]
Posted by varun at 2014-10-20 20:23:16
Apologies, I forgot. AOSP does have Exchange support, it's just a separate plugin. I was reminded today by the refreshed betas.
[ Reply to this ]
Posted by Damjan at 2014-10-20 09:31:05
You could've always used an owncloud server and DAVdroid or CalDav (both free software available in https://f-droid.org/ too)
[ Reply to this ]
Posted by stak at 2014-10-20 10:26:55
I can now, but owncloud wasn't around when I first set all this up. And anyway I'm a fan of writing stuff myself :)
[ Reply to this ]
Posted by aklotz at 2014-10-20 11:32:18
I'm super excited about this! Nicely done!
[ Reply to this ]

[ Add a new comment ]

 
 
(c) Kartikaya Gupta, 2004-2018. User comments owned by their respective posters. All rights reserved.
You are accessing this website via IPv4. Consider upgrading to IPv6!