Skip to content

Thunderbuddy: Weave-synchronized Thunderbird contacts on Android

I got my first modern Android phone at the end of last week and I figured it would be a good idea to get over the activation energy hump so it’s easy to do incremental mozilla hacking on it.  Thanks to a lot of work by other people, this turned out to be pretty easy.  It would have been even easier if the Android emulator ran at anything remotely close to real time or if my Samsung Galaxy S Vibrant (Bell Canada model) running 2.1 did not have a habit of locking up all the time.  (And this is before my code touched it, mind you.  I’m half-hoping my device is a lemon.  If anyone knows how to tell a lemon from lockups-as-usual, please let me know.)

The screenshot shows my Android device running the app.  It’s a super trivial wmsy UI showing contacts from my address book pulled down from a weave server that were put there by Thunderbird.

Anywho, props to:

  • Phonegap, the HTML/JS way to write mobile apps!  Major awesome.
  • weaveclient-chromium, a slightly bitrotted pure JS weave client by Philipp von Weitershausen / philikon (now of the mozilla weave/sync team) which built on the weaveweb project by Anant Narayanan and pure JS crypto work by the people mentioned in the README.
  • weaver and weave-ext by Shane Caraveo, which make weave happily run in Thunderbird and have it propagate the contents of the address book.
  • The Mozilla Weave/Firefox Sync team who made it easy and practical for software like Thunderbird to partake in the encrypted synchronization revolution.
  • RequireJS, CommonJS loader to the stars.

The relevant repos for those interested, are:

  • weaveclient-js: This is a fork of weaveclient-chromium that ditches the chromium bits, makes things CommonJS/Asynchronous Module Definition happy, and slightly factors out the encryption so that thunderbuddy can provide ‘native’ accelerated encryption support on android.
  • thunderbuddy: The phonegap android app repo proper.  The only really notable thing at this point is the custom Java class that implements and exposes faster ‘native’ encryption methods.  (Thunderbuddy can also just be used as a webpage on any reasonably capable browser with good JS performance.)

It’s worth noting that the goal is not actually to perform contact synchronization with Android.  There are already a ton of ways to synchronize your Thunderbird contacts with gmail and from there your phone.  The goal is to let other interesting data and meta-data propagate.  I just picked contacts for this example because Shane already had the data propagating.

{ 9 } Comments

  1. Bryan Clark | November 2, 2010 at 12:06 am | Permalink

    That is awesomeness

  2. Jonathan | November 2, 2010 at 12:26 am | Permalink

    Awesome!

    If I understand correctly, the app just shows the metadata pulled from the weave server, it’s not syncing it with the Android address book. Correct?

    What kind of other things would you like to pull from the weave server? How are the plans for the Thunderbird Weave^W Sync going?

  3. wabik | November 2, 2010 at 2:49 am | Permalink

    Yes indeed! And what about calendar/lightning data sync with Android? Did you have that in plan?

  4. Andrew Sutherland | November 2, 2010 at 3:17 am | Permalink

    Jonathan, yes, right now the app just grabs the data from the weave server every time and displays the information in the UI. It is not persisted anywhere. The next step would be to persist some of the data in localStorage, if only because the encryption is still pretty darn expensive.

    I personally am interested in using my mobile to fill in the short blank spaces where I might be waiting in line or what not with things that are a mix of productive and amusing. For example, synchronizing contact pictures to my phone so I can draw mustaches and funny hats on people and then synchronizing them back up. Delving into flame-wars for juicy nuggets or to perform some categorization so a morbid visualization of it can be made. And the like.

    There could also be good and practical things that could be done, but the reality is that I am sufficiently far out of the norm that it might be best to draw on other people for that.

    I think Shane has a revamp of the Thunderbird weave stuff planned.

  5. Andrew Sutherland | November 2, 2010 at 3:22 am | Permalink

    wabik, I think calendar/lightning is potentially in an even better synchronization place just because there is a standard for calendaring data, at least for consumption. I suppose modifying calendars could still be improved if the answer is not just “use the google solution”.

    In my eyes, the most exciting potential feature of weave is synchronizing data for which there is currently no well-established standard. That and more granular levels of privacy and trust. Weave originally had support for sharing information with other people in a cryptographically secure way. I think they lost that feature out of a need to focus and drive the core functionality through, but it’s still quite possible to pursue that, and I think it would be quite interesting.

  6. Jonathan Pritchard | November 2, 2010 at 7:11 am | Permalink

    Good work. I hope something like this will be available for my next phone, probably MeeGo. I do think that it’s worth trying to get straight contact sync between Thunderbird and Android, like you identify, there are many services out there that allow you to do it through Google, but that’s not the point.

  7. Andrew Sutherland | November 3, 2010 at 12:30 am | Permalink

    other Jonathan, yes, if you don’t already have Google in the picture (as could be the case for MeeGo), then direct sync through weave would be nice. Weave’s ability to keep your data private is great and it would be nice to provide that option.

  8. Kevin Francis | November 5, 2010 at 2:38 am | Permalink

    Your phone is a lemon. Galaxy S devices might stutter when installing apps, and other random places, but they will not lock up unless:

    1. You installed a load of crap software on it
    2. There’s a problem with it

    Try a factory reset, and if that yields no better then send it back for a exchange or something.

    If possible get a different device, like a droid 2 or a desire z while you’re at it.

  9. Andrew Sutherland | November 5, 2010 at 9:10 am | Permalink

    Thanks for the notes. My research suggests all Bell Mobility Galaxy S devices in Canada are lemons for the time being, at least until a new (2.2?) firmware gets released.

    I’m basing that off of this thread and other comments I’ve found around:
    http://forum.xda-developers.com/showthread.php?t=775017

    Long thread short, areas with bad reception (where it has to switch towers/bands/whatever) seem to result in lock-ups. It’s happy at my apartment where the reception is good.