“How do I get started with Xamarin?”
I get asked this question a lot lately, thanks to Microsoft’s acquisition of Xamarin. Less than one month after Microsoft announced the Xamarin acquisition at Build 2016, interest in Xamarin went up 3 times.
This is good for developers who want to play with Xamarin and build their mobile skill set using their .NET competencies, and those who want to switch to cross-platform mobile development from native side. Not to mention, the businesses that were not able to deliver their mobile apps in multiple platforms all at once due to cost and resources. Now they can with lower cost and in a lot of cases, with existing technical resources available, specially if they are a Microsoft shop.
Now is a great time to get introduced to the world of Xamarin. So, after that short intro, I would like to get started on answering the question asked above.
There is nothing I can tell you here that is not already published before around the web, but a great place to start, as usual, is on Xamarin’s own website http://www.xamarin.com
To save you some time, here’s what you need to know when it comes to the development environments.
Download Xamarin Studio. It will let you develop for iOS, Android, and Mac. No Windows UWP, Windows Phone compatibility here.
Xamarin Studio has been decommissioned for Windows in favor of world’s best IDE available, Visual Studio. Xamarin now comes with Visual Studio Community and Visual Studio 2015 Update 2 forward. In this configuration, you can develop for iOS*, Android, Windows UWP, Windows Phone, etc. This configuration is used by most enterprise teams. No surprise there.
- still requires a Mac build host.
For the sake of simplicity, when I say cross-platform, I mean iOS and Android. You can worry about Windows Phone and UWP apps later. This is coming from a guy who has native apps in Windows Marketplace 🙂
Develop native apps for iOS using C#.NET. In a cross-platform app, the platform specific code lives here.
Develop native apps for Android using C#.NET. In a cross-platform app, the platform specific code lives here.
Develop cross-platform apps using single code-base for UI as well using C#.NET and Xaml.
Now, I believe this is where rubber meets the road. How should you start?
You have two options to go about it, the right way, or the other way.
The Right Way…
I am of the opinion that you should start with basic knowledge of native platforms before jumping onto cross-platform train.
Let’s face it, if you don’t familiarize yourself with underlying bits and pieces of native framework, you will spend a whole lot of time and energy on bad workarounds after you’ve already started your first real world app – beyond Hello World!.
I suggest starting with a basic multi-page native app (in Swift for iOS or Java for Android) that has some sort of list view. That will teach you a couple of things,
- Native framework (lifecycles, views, controllers, connectors, data, etc.)
- How to design the UI
- How to manipulate the UI
- How to work with some data (getting data, passing data between views, displaying data in a list, etc.)
Once you have completed that exercise in the native worlds (say iOS and Android), you can step into Xamarin world. Now, if and when a customization is required, due to Xamarin’s limitations or bugs (yeah I said bugs), you will have an idea on how to handle it in native code.
- Knowledge of native world (lifecycles, views, controllers, etc)
- Helps when customizing app (when working with Xamarin.iOS and Xamarin.Android)
- Medium to steep learning curve
- Prolonged start time for your first cross-platform app, since you will spend time learning native first
But if you are impatient to see your code glory show up on cross-platform devices, you can also go the other way.
The Other Way…
The faster way to get your app up and running on cross-platform devices is Xamarin.Forms. With this approach, you can take your C#.NET and MVVM (or MVC) skills to town and whip up a quick app that has some basic functionality in it without knowing anything about the underlying native code magic.
This approach is well marketed and is very exciting. Lots of new developers and developers with WPF experience are tempted to go for this option and put their skills to test. Nothing wrong with that.
- Low to medium learning curve
- Quick start on getting your first cross-platform app going
- Xamarin.Forms is still new (at the time this article was written) and not everything works as expected. Also has bugs (hopefully open-sourcing will help expedite the fixes).
- If/When hit with a Xamarin limitation or bug, requires research and study of native code for workarounds.
- Using Xamarin.Forms for complex apps will lead to a slew of custom code in the native projects that can become hard to maintain with newer OS versions.
So, pick your preferred option and get developing. Or go parallel 🙂
Xamarin University is the best place to learn mobile development using Xamarin. There are several tracks that you can follow depending on your skill level and professional goals. One of the first thing you should try to get done, if possible, is to get certified. The certification lasts 1 year and requires about 17 live online classes and a comprehensive exam at the end. The exam will cover, OOP, iOS, Android, Xaml and other general knowledge in mobile.
In conclusion to my rather long post, take a look at Xamarin for your personal and professional mobile needs. For individuals who want to get into mobile development or have native mobile experience and want to go cross-platform, this is a great option – specially now that it is part of the Visual Studio Community edition. For businesses, It will help reduce the cost by not hiring specialists for each platform you want to go to market with, and will reduce the time to market somewhat.
For a discussion or question, leave a comment below. Enjoy!
Evolve 2016 Sessions (You can see yours truly asking a question in Xamarin.Forms session ;))
Channel9: Getting started video here
Checkout my sample app that is a nice demo of a basic app with Sqlite here
Xamarin’s James Montemagno did a nice intro to Xamarin.Forms here.