During last 12 month I was part of small but very mighty team. Our goal was implement mobile tablet-optimised application supporting 3 major platforms: iOS, Windows, and Android. At this stage, this project is almost completed, application is published in Apple, Windows stores and in Google Play. A lot of lessons have been learnt during this year and this what I want to share.
1. Why Xamarin?
OK. Why Xamarin? Let’s see which options are available and applicable to the requirements.
Requirements as defined by client:
Create three mobile applications (downloadable from application stores) which are :
- Have good performance (in user’s eyes)
- Able to reliably cache large amount of data for a long period of time
- Able to communicate securely with server (located either on customer intranet or in the cloud)
- UI/UX on different platforms must be very close to each other. The reason for this requirement is the fact that most of end-users are not technical people and some customers have more than one device type. E.g.: mix of iPads and Microsoft Surfaces.
One aspect that we need to take into account is that the client has large C# code base and legacy Windows Forms application which contains most of business logic to the new mobile client.
Let’s review our options for this project
- 100% native – 3 completely separate mobile application need to be created
iOS – Using Objective-C or Swift language with XCode as a development environment
Android – Using Java language and one of many Java dev environments
Windows – Using C# as a language and Visual Studio as development environmentIn this case three applications above will be completely different. From one side it is a positive factor, as changes/bug fixes on one platform won’t affect another. From the other side it is a big negative factor, as it forces us to duplicate such platform agnostic functionalities as client-server communication, business logic, etc. Also, it is very hard to find single developer who is very good on all three platforms. It could also lead to creation of three separate teams, necessity to maintain three separate backlogs, etc.
- Xamarin – 3 native application written using C# language.
This approach allows different degree of code re-use across different platforms. In most cases, business, data, and communication layers could be shared without any changes. In case of Xamarin.Forms, large part of UI can also be shared.
So, why did we select Xamarin as a platform for a new application?
First of all, initial scope of the project was defined as a re-write of existing WinForm C# application. Obviously we didn’t want to re-use UI and communication layers of 7+ years old app, however some of business logic could be re-used as is.
In addition, ability to work completely offline for number of days was one of the main requirements. It means that any browser-based solution risky and vulnerable to operating system updates.
As three platform release was originally planned, maximum re-use was one of main factors.
Based on all above, Xamarin framework was selected as a platform. But which flavour: Xamarin native or Xamarin.Forms ?