Code This

std::cout <<me.ramble() <<std::endl;

Building K-9 Mail With Exchange ActiveSync Support

with 9 comments

I have blogged in the past about the less than fortunate state of Exchange support in K-9. This is due to the fact that K-9 communicates with Exchange through and outdated and problematic protocol: WebDAV. WebDAV support is turned off by default in Exchange 2007, and completely removed in Exchange 2010. This of course implies that K-9 does not support Exchange 2010. Since I started working on K-9, I have had the desire to replace the use of WebDAV with the Exchange ActiveSync protocol, which is designed specifically for mobile devices. Unfortunately, this task was much too large for me to take on in my (non-existent) free time. Lucky for us Google sponsors the annual Summer of Code.

This year K-9 was granted 4 Summer of Code projects, including EAS support. The project was successful, and at this point we have “mostly working” EAS support in a branch of the K-9 repository on github. There are still a few small issues to work out, and a few small features to complete, but I currently use K-9 with EAS support for email on my phone. If you would like to build K-9 with EAS support for your own personal use, I am including step-by-step instructions for doing so (though as usual, I do assume some basic knowledge of source control and building java applications).

In order get the K-9 sources and complete a build, you will need a git client, a JDK, ant (you can also use eclipse, but I don’t include instructions for that), and the Android SDK (make sure it’s up to date). The first step is fetching the source:

git clone git@github.com:k9mail/k-9.git k9mail

This will clone the repository at git@github.com:k9mail/k-9.git into the directory k9mail. This fetches all branches in the K-9 repo, including the ms-eas branch where EAS support lives. The next step is to “checkout” the ms-eas branch:

git checkout -b ms-eas origin/ms-eas

This tells git to create a local branch named “ms-eas” that tracks the remote branch at origin/ms-eas, and switch to this new branch. Now you must build the K-9 source. First, create a file called ‘local.properties’ at the root of the source tree with the following entry:

sdk.dir=/path/to/android-sdk

Obviously, replace “/path/to/android-sdk” with the path to the Android SDK on your machine. The command to build is:

ant debug

This will build a signed and zipaligned installer ready for installation on your device. Finally, plug your phone into your PC via USB and ensure it is recognized by adb. To install the freshly built K-9:

adb install -r bin/K9-debug.apk

If you have K-9 installed from the market, you must uninstall it first. Your new K-9 will be signed with a different key than the market version and Android will not let you install this new version if the keys don’t match. Alternatively, you can give the app a new name in AndroidManifest.xml, but that’s outside the scope of this blog post.

If you want to report issues, feel free to mail k-9-dev [at] googlegroups.com.

Advertisement

Written by Kris Wong

September 29, 2011 at 3:29 pm

9 Responses

Subscribe to comments with RSS.

  1. Any rough estimate (a few months? longer?) on when this might be ready for the masses? I’ve been hoping for an update on the summer of code project for a few months, but really am waiting for it to be integrated into the main k-9 tree.

    Dylan

    October 24, 2011 at 2:46 am

  2. Our SoC student working on this project expressed the desire to continue to work on it after SoC ended. However, he has not done any work since. This leaves me to slowly hack on it here and there. I have a laundry list of issues to fix before this will be ready for prime time.

    Kris Wong

    October 24, 2011 at 11:38 am

  3. For people needing a more immediate solution, I think DavMail http://davmail.sourceforge.net/ can bridge the gap. It’s essentially an imapexchange proxy.

    anon

    October 25, 2011 at 9:03 am

    • Interesting suggestion. Exchange server itself also supports IMAP/POP/SMTP, if enabled by the administrator.

      Kris Wong

      October 25, 2011 at 9:46 am

  4. Are you interested in any kind of feedback/testing?

    I compiled and installed ms-eas branch and although it works with Hotmail EAS, all email come with the date is synced rather than the actual on the server, which ruins any real chronological order.

    Let me know if you need logs/debug information. I’m not a programmer but a many years experienced Linux user. With very little instructions I can provide what you would need.

    Manuel

    November 26, 2011 at 8:40 am

    • Beta testing is always good, but this feature isn’t quite ready for beta yet. I’m still working on much larger changes. Hopefully it won’t be too long before I can start worrying about the details!

      That being said, I don’t recall having seen this particular issue.

      Kris Wong

      November 30, 2011 at 11:13 am

  5. While waiting on k9 I sunk $10 into “Enhanced Email”. ActiveSync is must have for me — that and true IMAP4rev1.

    I use Hotmail and yahoo. I do not use Gmail. Incidentally Gmail employs ActiveSync. (Go on, try it)

    Issue 750 has a claimant of activesync (EAS) capable build of k9

    http://code.google.com/p/k9mail/issues/detail?id=750#c34

    More power to the k9 team for the fork :) I plan to motivate some people to donate in the name of activesync ;}

    bob android marley

    November 30, 2011 at 6:32 am

    • I know gmail was used extensively for the initial development of this “feature” (which was done by a GSoC student).

      I had briefly looked at EE in the past, I couldn’t see any difference from the stock email application (not that I really looked very hard).

      Kris Wong

      November 30, 2011 at 11:22 am

  6. Hi Kris,

    I see on Android Market that K-9 was just updated, February 15, 2012. I know you have serious time constraints, and the K-9 app as it is is fantastic! As others have mentioned, though, the only (for me, really, absolutely only) missing feature is any sort of Exchange 2010 support.

    Do you have any general estimate of when you think the ActiveSync support pre-alpha version of K9 will move past that stage?

    Thanks a ton and keep up the great work with this program!

    John Markus

    February 22, 2012 at 10:56 am


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.