It is no secret that Microsoft has had a very hard time creating a good mobile experience. They failed very early to compete with the likes of Android and iOS, and its Windows Phone 7, 8 and 10 Operating Systems remain huge failures. Microsoft’s biggest problem always was apps, the app ecosystem simply wasn’t there.
I’m not talking about desktop apps, Windows 10, being Windows, has all the apps you have always used: Evernote, Office, Chrome, the Adobe Suite, Visual Studio, Android Studio, Slack, etc. But apps like Instagram, Snapchat, Facebook, Twitter, PayPal, Foursquare, Messenger, etc that provide a great experience for iOS and Android users were never there, or provided an awful experience.
So Microsoft deployed a ton of resources into trying to convince developers to migrate their apps from those platforms over to Windows, or even better create them for the three platforms at the same time. Enter Xamarin.
How Xamarin helps developers.
While the success of these efforts bringing apps to the Windows Store is questionable, it is true that Microsoft is now the owner of an amazing tool for developers, that allows them to develop apps for Android, iOS, Windows and potentially (with some additional configuration), macOS and Windows desktop and share up to 100% of the code between platforms!
This is simply amazing, using Xamarin one can code once on C#, create the design of the app once with XAML, and deploy it as entirely native Windows 10, Android, and iOS apps.
How does Xamarin achieve this?
Essentially, Xamarin will translate the C# and XAML code to a native Java and Objective-C application (for Android and iOS respectively), so the interface that you create in XAML ends up using native controls. This means that you can define one button in XAML and Xamarin will compile it as a native Button for both Android and iOS, so the interface looks native, because it actually is.
The logic, coded in C#, is also compiled as Java and Objective-C code, so your apps run smoothly, as if they were native, because again, they are.
The same happens the other way around, the Xamarin team is always hard at work exposing the native libraries from Android and iOS to your C# code so you can implement native functionality to your apps. Want to add Touch ID functionality? Face ID? NFC? Fingerprint Id? You can do that with Xamarin.
Why use Xamarin over “traditional” development?
In case it isn’t entirely clear yet, Xamarin allows you to code once and deploy for Android, iOS and (if you want) Windows. This means that you and your team no longer need to code once for Android with Java or Kotlin, and another one for iOS with Objective-C or Swift, you can code once on C# and deploy to your users on both platforms, essentially cutting your development time in half.
If you are a freelancer, you can now build apps for your clients for both platforms, coding only once. Business owners now won’t need to hire one team for each platform, they only need one team that develops using Xamarin.
Xamarin sounds too good to be true, what’s the catch?
The Xamarin features that I have described above (called Xamarin Forms), the one that allows you to share 100% of your code between platforms, coding with C# and XAML, has it’s limitations, especially regarding UI creation. While it has become more powerful, more efficient, and more resemblant to defining the UI with XML and Storyboards (as is the case when developing from Android Studio and Xcode), there are still some small bugs here and there.
If you need a perfect UI, you can always use Xamarin but define the UIs with classic XML and Storyboard. This won’t allow you to reach 100% code share, since the UI is defined once per platform, but the logic can still be shared, since the codebase is still coded in the same language.
Overall you need to decide what do you prefer, a spotless UI or a better code sharing experience, but in most scenarios, Xamarin is definitely a great alternative to coding the apps once per platform.
Additional Xamarin Advantages
Like I said, Microsoft really needs developers to make apps for its platform, even if it means create a better experience for iOS and Android developers at the same time, so along with its IDE (Visual Studio), Microsoft has released some interesting tools that make Xamarin development even more attractive.
If you have ever developed apps for Android, you know that testing them on a simulator can be a pain. Some simulators take forever to start, and sometimes even with the simulator already up and running, the app has troubles launching. Microsoft has released some tools for this to be more seamless, so testing Android apps can be faster
And if you have ever been interested on building iOS apps, you know that a Mac computer is necessary. Well, with these tools Microsoft includes in its IDE, you can test without the need for these Mac computers, all you need is an iOS device to be able to deploy your app to it, test the design, and even the functionality. There are definitely some limitations, but for developers that don’t have a Mac computer, this is a lifesaver.
This doesn’t mean that you won’t ever need a Mac, you will eventually need it, but for that you can always quickly borrow one from a friend or from your school while you use your phone or tablet to test most of the functionality, even from Windows.
Let me tell you a small story
I know a couple of particular developers that after college were struggling to find a well paying job. They were good developing Android apps, but supply for any Android app developer position was huge, so wages were often below what they expected.
It was only after they found out about Xamarin that they were able to present themselves as the solution to the problem many businesses were having: it was becoming to expensive or it took too long to develop a multiplatform app. They started to offer that, if the business traditionally took 4 months to develop an app for both Android and iOS with a team of 10, they could do it with a team of 5 in the same time.
These two developers quickly became the Project Managers for their own teams, and continue to offer great value to their companies, of course by continuing to develop using Xamarin. Xamarin is truly an amazing tool, that allows you to be a more efficient developer, and mastering it, is one of the greatest investments you could make as a professional developer nowadays.
I was so impressed with Xamarin that I become Xamarin certified, and went on to release the Complete Xamarin Developer Course For iOS And Android. Its a very comprehensive course with great reviews from the students who are enrolled in it and will help you become up to speed and productive with Xamarin very quickly.