Mobile, Xamarin

Xamarin Forms – Getting started.

I’ll get straight to the point. This link here has some great tips on learning Xamarin Forms.

David Ortinau is the Xamarin guru. I learned about his involvement with Xamarin by another guru in the St. Louis area named Kevin Grossnicklaus who founded ArchitectNow. When I’m trying to keep up on the latest trends/technologies, Kevin is the primary source that I’ll follow. Kevin is not only specialized in cross platform development in mobile technologies (like Xamarin), but he is also extremely versed in web technologies like Angular(2+)/AngularJS(1), React, ASP.NET/MVC/etc..
Kevin taught at the Xamarin Dev Days back in July 29 of this year. It was an amazing all-day event where we got to develop a cross platform apps that would work on Android, iOS, and as a UWP app. At that event was David Ortinau who provided all kinds of excellent info/feedback.

Xamarin is for real. There’s nothing you can do in Swift or Java for iOS/Android apps that you can’t do in Xamarin. You have all kinds of choices and approaches you can take with Xamarin. You can develop (in C#) against the Android/iOS native API (thru bindings) directly. In iOS, this requires you to understand the native concepts such as storyboards, protocols, navigation controllers, view controllers, etc.. In Android, this requires you to understand the native concepts such as Activities, Intents, etc.. Instead of using Swift or Java, you’d use C# (as it binds directly to the native APIs).

In the above scenario, you are typically sharing your business logic (business objects) and/or classes that would issue REST calls, authentication. Your UI code would be different between the two platforms (and you can use the familiar designer with iOS (similar to XCode)) and one for Android (similar to Android Studio). But it’s all in C# allowing you to leverage your knowledge of the things .NET devs really love about .NET (ie, LinQ, etc..).

An additional scenario called Xamarin Forms started out back in 2013 as MVVMCross. For those who’ve done Silverlight and WPF applications, you will be right at home with Xamarin Forms. I did quite a bit of Silverlight and WPF apps in the past which involved coding the front-end templates in XAML with bindings (1 and 2-way) to the backend C# code. You can also take advantage of .NET’s event propogations (and INotifyPropertyChanged) and a pattern called MVVM (Model View / View Model) which allows the ability to unit test your view models. By using that along with the Command pattern, you end up with XAML templates with property/event binding to your view models and you can perform two-way updates (ie, your model can inform your view of changes and vice-verse).

The beauty of Xamarin Forms, is that you can do all of this within a mobile app which means you would not have to be “as familiar” with how iOS apps do their thing and how Android apps do their thing (from a front end perspective). I’m oversimplifying this and I’m not recommending that you avoid learning the iOS and Android api. From what I understand, the newest release of Xamarin Forms will allow you to mix forms and native screens together (I plan to research that more). The newest release also addresses the multi-rendering performance issue in Android with “fast renderers”.

My take on Xamarin Forms (from the video courses I’ve taken on Udemy/Pluralsight) is that it’s awesome for “forms over data” applications. Although you can do a lot more with it. Being that you can now mix and match forms with native pages (like you would with Xamarin.Android and Xamarin.iOS), this opens up a whole new world by which you can save a ton of development time by sharing your UI code for many screens while still being able to write specific code (pages) for your iOS/Android where it makes sense (ie, graphics intensive screens, etc..).

In one of David Ortinau’s Mobile App Design and Xamarin Forms 3.0 Preview Podcasts (in Xamarin Podcasts), he does mention that developers do “not” allow Xamarin Forms to interfere with having a clear understanding on how to develop your iOS apps to have the iOS experience and your Android apps to have the Android experience. Having said that, you can still customize your forms apps to do specific things depending on the platform you’re running in.

Xamarin Forms has come a long long long way since it’s MVVMCross days back in 2013. It’s ready for prime time!

Leave a comment