In my team’s most recent client work, we’ve been tasked with cross platform mobile development. It is an extremely fun project with an aggressive timeline. Some of the technologies involved so far are:
Use iFactr to programmatically build layers (screens / views) for our application. iFactr works off of the Xamarin framework, so we have the ability to make small tweaks to each version of the application (iOS / Android).
- One code base – multiple platforms: iOS and Android
- Quirkiness of two project files with shared iFactr code – setup and maintenance of an Android and iOS version of (almost) identical projects was difficult – think namespace, file link, reference issues
- Testability of application and business logic – only certain types of projects can reference Xamarin – unit tests only available for iOS and must be run on device (or simulator)
- Restriction to iFactr deployment platforms (yes, there are several but why restrict yourself?)
New Ideas – MVVM and PCLs
Use Model-View-ViewModel concepts and portable class libraries to expand and better our solution. Move all models and view models to a portable class library, along with custom defined application service interfaces. Implement services in the same project, but have the ability to later leverage dependency injection for a modular solution.
- One code base – more platforms: iOS, Android, Windows 8, WinPhone, WPF, Xbox360, etc.
- Testability of application – standard MSTest projects that reference PCLs to test functionality
- Learning curve – setting up a PCL for MonoTouch, MonoDroid, and .NET assemblies is not a trivial task – there isn’t a step by step guide out there
As mentioned, there isn’t a step by step guide anywhere but I did find some extremely helpful resources from this blog by Stuart Lodge.
I’m happy with where we’ve taken the solution. I plan to continue learning about PCLs and portability in general. My goal for this year is to make some type of applications that ports to all the platforms listed above (and possibly more).