The road is hard and unfriendly

What I discovered while working on Android auto-configuration

I will start by the obvious conclusion: I did not find a way to automatically configure an email account on an Android phone or emulator. And I find it annoying. If anyone got some tips to help me…


At LINAGORA we are preparing the launch of the Minimum Viable Product of our new flagship product OpenPaaS.

We chose to rely on existing apps to manage emails, calendars and contacts on smartphones. So we took the “connector” road: we provide the server with standard protocols, namely IMAP, SMTP, CalDAV, CardDAV, and configure the smartphone system.

To bring to the user the best possible user experience, we decided to provide to the users an app that will handle the configuration of the different protocols. So, the user just enters their email and password, and everything is then setup automatically on the smartphone.

Well, that was a nice idea, and it works fine on iOS.

The state of connectors in Android

We expected Android to have connectors for every protocol we wish to handle. Unfortunately, Android does not support Cal/Card DAV protocols out of the box. However, using the great DavDroid code, we were able to quickly get our calendars and contacts synchronized on the phone apps. Wonderful.

And then we hit the wall. As we discovered, emails are not seen as “IMAP connectors” or “SMTP connectors”. The way we access emails is tightly tied to the application.

Let me rephrase it differently. On Android, install 3 calendar applications. Setup DavDroid connectors, or Google Agenda connectors: your calendars and events appear in every of the 3 calendar applications. Now, install 3 email applications. Setup an IMAP access in one of the application: your mails won’t show up in others. That’s because, on Android, email transport and views are all provided by the application. Which is to say, that every email application, that want to provide IMAP access for example, has to code the IMAP client protocol… Weird if you ask me.

Digging the Android providers

Ok fine, the Android ecosystem being built like that, we tried to configure programatically an IMAP account in the Gmail application. On Android, applications can expose Account providers, and then there is a method to create an account using a provider of a certain type. Using some reverse-engineering, we were able to find that the GMail IMAP provider type is However, nothing is documented, we don’t know how configuration fields are named, so we were unable to code a creation of such an account.

That’s where we stand

I’m looking at the dead-end I fall into, and ask for advice for another way to get auto-configuration on the Android platform. I looked up on MDM solutions, but could not find useful information out of them. Right now I’m stuck, and have this strange feeling, that the platform does not provide easy way to setup email accounts because, well, the maker doesn’t want it to be easy…