A Couple of Design Changes to MobilityDojo.net

This isn’t exactly newsworthy, but if you’re a frequent flyer on this site you’ll notice that the design has changed ever so slightly. I upgraded the theme, and re-arranged a couple of page elements. While it’s still very similar to the old design, it feels a little bit fresher to my eyes.

Now, if I just moved around a few labels I probably would not have bothered writing up a post. The main thing that has changed is that I’ve now added a banner ad, and thus many would consider this as cluttering up the design. (I don’t know if there’s someone who considers it selling out in general to use advertising.)

I know the feeling. And it’s an experiment I’m doing. Does it make the site less appealing? Maybe. Do you just mentally block it out and ignore it? Maybe. (I tried to not make it ovecr the top flashy.) Why did I put a GoDaddy ad there specifically? Well, and don’t take this as me putting on my marketing hat; I’m really happy with the SSL certificates they offer. I use them both at home and work – they work on pretty much all devices I test, and they cost a fraction of a VeriSign certificate. Might not be the right choice for everyone, but works for me. So while I agree that it’s still an ad, it is at least a product I can recommend. With Google ads I’d have less control, and would probably need to generate way much more traffic to get any noteworthy amount paid out. (If GoDaddy pays off I do not know either of course.)

I did not start this site to make big money. And I’m making good on that premise so far :) Web hosting doesn’t cost all that much, and there’s no doubt the main investment is the amount of hours I put into it. Not much up-front cost in other words. The other cost is the hardware I use to test/develop and document my articles and utilities on. And I’m the kind of guy who would undoubtedly have a computer or four at my home whether I’m running this site or not :) I could of course make do with even more gadgets and stuff in my lab.

I might perform a few other minor tweaks the next couple of days too, so don’t worry if it looks a little different one day, or there’s a new page or something.

I’ve also contemplated adding a PayPal donation button for those who feel like giving. (Does it make me sound needy? It would be completely optional.) Don’t worry though – I’m not going out of business, and I’m not changing this to a commercial site. If you enjoy my work please continue doing so.

I’m open for input, and feel free to post your thoughts in the comment field or ping me.

This service announcement was brought to you by the benevolent host of MobilityDojo.net :D

Rolling Your Own Exchange ActiveSync Client

I got my hands dirty with ActiveSync two weeks back (http://mobilitydojo.net/2010/03/17/digging-into-the-exchange-activesync-protocol), and shared the results with you here. I also mentioned that doing the things I did required a few lines of code since not everything could be done in Fiddler. Because of this I promised you I had something in the works to let you actually play around too, without cracking open your Visual Studio, and now I’m trying to make good on this promise :)

I introduce to you, the first beta release of “Exchange ActiveSync MD”. It is a desktop app that will let you emulate a device connecting to ActiveSync. Yes, it is similar to what www.testexchangeconnectivity.com, but I only focus on EAS, and I have a couple of options not present in the ActiveSync test MSFT provide. It will require you to have .Net 3.5 installed on your computer – I’ve tested it running on Windows 7 and Windows Server 2008 R2, but it should work on other Windows versions too with .Net present. It will not require an installation, and you can just run the .exe file itself.

It has only three screens to relate to, and while most of it is fairly self-explanatory, (doesn’t always the programmer believe this to be the fact?), I’ll walk you through it:

Main
image

This would be the place you’ll be finding yourself in most of the time using this simple app. There are two tests you can perform; “Basic Connectivity” and “Full Sync”.

Basic Connectivity: for this test you will need to provide the connection parameters, but you can ignore the other options and parameters. This test will perform a HTTP GET against the specified server address to pinpoint basic issues like DNS resolution, server being reachable, and authentication. If the GET works you’ll get a 501/505 the same way as opening the address in a browser. If the GET goes through a HTTP OPTIONS is done against the server to pull down info like server version, etc.

Full Sync:
You still need to fill out the connection parameters, but there are default values provided for the other options. (The connection will be made at the Exchange 2007 RTM level if nothing else is specified in MS-ASProtocolVersion.) The program will attempt the FolderSync command, and provide response based on the security polices in effect on the server. You will be informed in the output window if the sync didn’t go through for some reason, and a tip for correcting it.
For Device ID, Device Type & User Agent you can specify whatever you like as long as you’re not using the new features in Exchange 2010 for restricting these parameters.
The “Device Properties” are additional attributes you might need to set for the sync to go through.
The output window has switches for binary, hex, and base64. Most likely you’re not going to need them all that often. (This only applies to the response body, other text and headers are in plain old text format.) I had to use it for some debugging purposes since the wbxml isn’t all that easy to read.

Certificate Info
image

While you can ignore any certificates issues on the previous tab it can be very handy to pull down the chain and see why it fails if you weren’t expecting it to fail. You don’t need to provide any credentials – just point it to a server running SSL (on port 443). The app then establishes a socket connection and pulls down the chain. Some basic info is printed out, and at the bottom the certificates themselves are embedded in base64. This means that you can open up your Notepad, paste in the string, and save the file with the extension .cer and you will have a certificate file you can use. I am aware I could have provided a possibility for provisioning it directly into a certificate store, but that felt like more work than it was worth :) I could also have pulled all the certs into a single p7b format, but.. well, it works the way it should and serves my purposes in it’s present form. Let me know if there is something that is missing from this tab in the feature department.

Base64 Utility
image

I often find my self needing to convert between a base64 string and plain text when testing, so I just included a tab for it in this app. You might not need it that often, but it’s convenient to have easily accessible.

So does it actually work then? I’ve tested against Exchange 2007 SP1/SP2, and Exchange 2010. No Exchange 2007 RTM unfortunately (even if it’s a choice on the list), and Exchange 2003 is not on the supported list yet. (Of course you can test all client versions against the latest server version since Exchange is backwards compatible.) I believe I have tested the different combos of enforcing policies and blocking non-provisionable but there are differences between each AS-version so I cannot guarantee at this time that there’s not some sneaky bug somewhere. (It is a beta for a reason you know.)

I’m also aware that the interface looks kinda “not done by an actual designer”, and while I do like creating 3D graphics and related stuff I never was top-notch at creating user interfaces :)

There are two known issues I haven’t solved at the present time: 
- If you turn on “Trust all certificates”, and then uncheck it you’ll still be trusting all certificates. Workaround is to close the program, and re-start.
- If you have a username and/or password with special characters it might not encode properly, and thus you’ll get a 401 returned.

I am aware of these issues, and will try fixing them. The issues I am not aware will be fixed later on.

While not a bug as such, the internals doesn’t exactly conform to what could be considered “beautiful code”, but that might not be the most important thing at the moment I guess :) (Obviously in the process of cleaning the code, maybe I come across a line that need to be fixed up to so it serves a purpose too.)

My first focus is to do some additional testing, and making sure everything works as advertised. The second priority, which is more fun obviously, is adding new features. How many features could you cram into a small utility like this you say?  Technically you can implement a fully featured ActiveSync client, and while I’m not going to do that the next weeks I am investigating if I can implement wbxml parsing. No promises yet though.

In the meantime, test it out, see if it’s useful, and let me know if you have any questions or feedback.

Download: http://mobilitydojo.net/downloads/ (Sends you to the download page so you can fetch the latest release.)

Windows Phone 7 and Exchange ActiveSync

By a happy coincidence Windows Phone 7 had it’s technical unveiling at Mix 2010 just as I was wrapping up my previous write-up on ActiveSync. Microsoft also released an emulator for developers to start coding for the new OS. If you’ve been following the news mill you’ll know by now that there are some major changes this time around which differs from previous platform upgrades. While you will still be able to leverage knowledge like C# you have to make do with Silverlight or XNA, and compared to previous releases of Windows Mobile this breaks quite a few applications. (Only OEMs get native code access, and even they will be restricted as to which native APIs they can use.)

The emulator as delivered from Microsoft has a few limitations though:
- It requires you to install a “Phone Edition” of Visual Studio. (Which may come in conflict with other Visual Studio stuff you have installed previously.)
- It does not run in a virtualized environment like Hyper-V or Virtual PC. Probably because of the DirectX 10 requirement.
- You have to start it through Visual Studio.
- You can only use your own apps, and Internet Explorer.

And while it’s not a limitation as such it’s an x86 build, so for those hoping to get a hacked version onto their HTC HD2 there’s no solution yet. (I would not be surprised if some crazy guy managed to disassemble it, re-compile for ARM, and get it to run on a three year old device just for the fun of it. I’d be mighty impressed though.)

Well, let’s see… I can live with it requiring Visual Studio, and as luck has it I have a physical Windows desktop I can install to. Check.

You can run it stand alone if you install Process Monitor, start the emulator in Visual Studio, and capture the command line it invokes (in Process Monitor). It will look like this:
C:\Program Files (x86)\Microsoft XDE\1.0\XDE.exe” “C:\Program Files (x86)\Microsoft SDKs\WindowsPhone\v7.0\Emulation\Images\WM70C1.bin” /VMID {GUID}
The GUID is the reason you have to capture through Process Monitor.
Check.

While I cannot provide links or further info, there is also a method that will allow you to “unlock” the image and use all the goodness, and not just the browser.
Check.

Now what is the first thing a guy checks after getting access to the entire OS? Setup mail synchronization of course! Here’s what it looks like:
Locate “Mail setup” in the menu.
image

If you choose “Outlook” it seems you need a functioning AutoDiscover setup. Since I don’t have this on the Exchange I’m testing against I chose “advanced setup” which will let you specify the server address manually.
image

Enter your email address and password.
 image

Seems kind of different to the present wizard, but only after providing the address you get to choose what kind of account it is.
image 

Settings – upper half of wizard page.
image

Settings – lower half of wizard page.
image

The account will pop up with the familiar Outlook logo (and the account name you provided) on the menu.
image

Upon entering and starting to synchronize I get a info message telling me I need to apply some policies. I have checked Power-on-Password and encryption, and unchecked the box that will let non-provisionable devices sync.
image

Defining the password.
image

Lo-and behold – I’ve got a mail in my inbox. (Notice the filters – “all”, “unread” and “urgent”.)

image

Since Outlook 2010 introduces the possibility to have multiple Exchange accounts it is not entirely surprising that Windows Phone 7 will make no fuss when configuring multiple “Outlook accounts” on your device. (No, I don’t know how it plays out with different policies in effect.) I’m seeing some problems syncing in general, like reluctance to sync before I send a new mail to the inbox, but it is a CTP/Beta so far so I guess we’ll have to accept this much currently :)

The device reports the following info about itself:
user agent: MSFT-SPhone/7.0.6077
DeviceModel: XDeviceEmulator
DeviceOS : Windows CE 7.0.6077
DeviceType: SmartPhone
ASProtocolVersion: 14.0

I don’t know if this is a beta thing, or a change of direction, but as you can see it reports itself as a SmartPhone – not PocketPC, even though it has a touch screen. (Might it be that the difference between a SmartPhone and PocketPC is the absence/presence of a physical keyboard? This would be a wild guess of course, and I really wouldn’t know.)

This is just my first impressions after a very quick spin of the new OS. I expect to be investigating relevant matters further. And when I say relevant I mean related to topics usually covered on this blog. While I love the Zune interface, and see this as a potential iPod replacement, I’m not covering those features here.

You are probably also understanding to the fact that this is an early build, and before we see actual devices hitting the stores later this year it may all change…

RSS for Posts RSS for Comments