If you’ve landed on this blog post after a brief click around the Sequence site, you might have noticed that we’ve recently done some work for the British and Irish Lions, producing an app for the 2013 tour that is available on seven different platforms. When we first sat down to work out how we were going to build the app, we looked at the requirements, the number of platforms and our time scales and realised that we had a bit of a problem. To build a native app for every platform was going to take time – time that we didn’t have. And we didn’t think Warren Gatland was going to push back his squad announcement for us. Not even if we asked him nicely.
So we had to look at how we could build the Lions apps in a cross-platform way, reusing as much code as possible. We looked at the options – PhoneGap, Adobe Air, Titanium etc., but although these would have been quicker than writing native apps, they either didn’t give us enough access to native functionality and controls, didn’t give us the performance we would need or wouldn’t allow us to achieve the desired quality of finish within the available timeframe.
Instead we decided to plug for a full .NET solution, consisting of a PCL (Portable Class Library) common core plus platform-specific UI layers, using Xamarin on iOS and Android. With this architecture, anything that was common to all platforms could go into the core and be written and maintained just once, saving us time and money.
To write an app this way, we needed an architecture that achieved maximum separation of concerns between our platform-specific UI and our common business logic, whilst keeping the UI layer as lightweight as possible. We’d previously written Windows 8 and Windows Phone applications that used the MVVM design pattern to do just that, and so what we wanted was a way to use the MVVM pattern in a cross platform application.