We recently upgraded our Exchange server from 2003 to 2010 SP1 which has given us some great new features, including the far better web mail which actually works properly on non-IE browsers.
However, for the majority of the Android users in the organisation the change meant that the default email application stopped being able to connect and returned an “Unable to open connection to server” error.
The devices/carriers/versions and whether they could connect or not are listed below:
|HTC Desire||2.2||HTC Stock||No||3 mobile||Success|
|HTC Desire HD||2.2||HTC Stock||No||Vodafone||Success (After OTA update)|
|HTC Desire HD||2.2||Cyanogenmod 6.1.3||Yes||Vodafone||Fail|
|HTC Hero||2.1||HTC Stock||No||Vodafone||Fail|
|T-Mobile G2 Touch||2.2||Cyanogenmod 6.1||Yes||T-mobile||Fail|
|HTC Magic (32B)||2.2||Cyanogenmod 6.0||Yes||Vodafone||Fail|
As you can see, for the device and version combinations there was a mixed bag of results.
Trawling the web it would appear that this is a pretty common occurrence and has seen an outpouring of flak on Google. It looks like this has now been resolved (click here to see the defect status updates from Google) and is in the process of being rolled out.
However, due to the way in which the Android release cycle works, it could be months before this fix manages to work it’s way through to the manufacturers and then the carriers before it hits user’s phones.
As all of us rely on having access to mail from our phones, we needed to find a workaround or fix that could be implemented sooner rather than later.
This was a solution that has apparently worked for a number of organisations.
- Remove the Android mobile devces affected from each users mailboxes.
- Remove the Default (and any other ActiveSync) policy using EMC
-- Remove-ActiveSyncMailboxPolicy -id ;setting all users to no activesync policy
- Setup the Andriod phones to sync and let them get past the initial synchronization.
- Recreate the ActiveSync Policy and set it back to default.
Luckily for us our senior sysadmin, Max, is always willing to get stuck in and try and get a workaround in place (even while muttering “this isn’t a problem on the iPhone” under his breath) and tried this one out for us, but for the Skinkers set up it did not work.
We then came across a post by Alexandros Schillings on his blog with a device based workaround which extracts a working email.apk from an Android emulator instance and installs it on your device.
Every Android user in Skinkers who had this problem (see above) have gone through one of the processes outlined below and in our experience it has been 100% successful.
- Android SDK with ADB
- An emulated device (2.1 or 2.2 depending on what your phone is running)
- Your Android phone
Before attempting any of this, please be aware that we cannot be held responsible for any damage to your device.
Any modifications or tweaks that have been made to your email client by your manufacturer, carrier or ROM creator will be lost as this will be the stock email client from the AOSP ROM.
Finally, if you use the installation method mentioned first, you will overwrite your original email application. If you don’t want this to happen, please follow the second method which requires root access to the phone.
Make sure your phone is plugged and USB debugging is enabled (Settings > Applications > Development > USB Debugging).
Also, make sure your emulator is running (the correct version to match your phone).
Finally, make sure that your phone is set to be able to install applications from unknown sources (Settings > Applications > Unknown Sources)
From a command prompt type:
and make sure both your phone and emulator are listed:
adb -e pull /system/app/Email.apk
to pull the working email.apk from the emulator into yor current directory (the -e switch directs the command to the emulator as opposed to the device):
We now need to install that Email.apk onto your device.
Alexandros’ initial post outlines a method that requires you to have root access on your phone. However, it turns out this is not strictly necessary, and you can simply install the new application over the old one.
From the command prompt, type:
adb -d install Email.apk
adb -d reboot
This worked for our stock 2.1 Hero user, but for the 2.2 G2 Touch running Cyanogenmod 6.1, we get the following error:
If this happens, simply revert back to the method of pushing the app that requires root access as follows.
Execute the following commands in sequence:
adb -d remount
adb -d pull /system/app/Email.apk Email.apk.bak
adb -d push Email.apk /system/app/
adb -d remount
adb -d reboot
This will temporarily remount the system partition as RW, make a backup copy of the original Email.apk to your hard drive (as Email.apk.bak), push the new APK to the device, remount the system partition as RO and finally reboot the device.
That’s it! Now, fire up the email client and enter your Exchange server and account details and you should have your Exchange account ready to sync on your device.