My Xamarin experience

Recently I and two fellow developers have started development of a mobile platform for our needs. Of course, we did have in mind both Android and iOS, so Xamarin looked like a nice choice. According to the official website, it offers cross-platform compilation, yet stays with C# language and all familiar IDEs like Visual Studio. So I decided to give it a try.

xamarin-visual-studio

Xamarin offers free Starter edition for small projects and indy developers, so I’ve just downloaded the installer and run it. After pressing Next the installer window disappeared leaving me to guess what is happening. With the closer look at task manager, I have guessed that it is downloading and installing Microsoft .NET Framework 4.5 along with Russian language pack. Ok, that’s not a problem, though some kind of notification would be nice.

It turned out eventually that Starter edition lacks iOS support and Visual Studio integration, and that is definitely a drawback. After checking Xamarin.Android, I was presented with a following list of features to be installed:

  • JDK 6
  • Android SDK
  • Android NDK
  • GTK#
  • Xamarin.Android
  • Xamarin Studio

To set it all up, I need to download about 1.1 Gb from the Internet. Hmm, why should I?.. Let’s take a closer look.

  1. I have JDK 7 up and running, yet Xamarin wants JDK 6. Looks a little strange to me.
  2. I have all the necessary SDKs for Android 4.4.2 because I prefer to work with the most fresh developer APIs. Xamarin wants to download several older versions, namely 2.2 to 4.0.3, without asking, whether I actually need them. The same is valid for Android build tools.
  3. I don’t need NDK either, because I don’t use native C in my work.
  4. Seeing GTK# here is strange too, It indicates that Xamarin Studio is not a native Windows application.

Ok then, I clicked ‘Install’ and went to make some coffee.

After installation process completed I started to explore Xamarin features. After native Android development experience with IntelliJ IDEA Xamarin was a little disappointing. Here is the list of questions and disadvantages:

  1. Just like I thought earlier, older Android SDKs were installed mainly to create virtual devices. Working with Google emulator proved to be difficult due to its startup time, so I use Genymotion instead. Unlike IDEA, Xamarin doesn’t work with Genymotion.
  2. Xamarin Studio works with 4.0.3 SDK and below, which seems to be outdated (4.4.2 is available via SDK Manager).
  3. NDK was installed to my Windows user profile directory without any prompt for destination path. And, once again, it’s big in size and I don’t need it.
  4. Xamarin doesn’t support build systems like Gradle.
  5. Programmer still needs to create separate projects for iOS and Android, this is basically doesn’t differ much from native development process (not a real advantage of reusability).

As a conclusion, I can say that if you are about to start a new mobile project, if you want to make it cross-platform and if you know C# only, then Xamarin can be a good choice, though its installer certainly needs some more interaction with the user and overall flexibility. But if you already have an Android application and you want to port it to iOS, then you win nothing by switching to Xamarin. I’d recommend to learn Java/ObjectiveC/whatever-you-are-missing and stay native.

P.S.: Xamarin Studio is actually a fork of MonoDevelop, that’s why it requires GTK#.

P.P.S.: Image is borrowed from Xamarin official website.

Advertisements

Published by

Victor Lapin

Head of a Software Development Group

4 thoughts on “My Xamarin experience”

  1. Thanks for sharing your experience. I have done Android development with both the Eclipse ADT from Google (although I haven’t used the new Android Studio built on IntelliJ) and Xamarin Studio. My perspective is that I had more trouble setting up the Android Developer Tools for Eclipse (and their dependencies) than I did setting up Xamarin Studio. Also, you can use the latest version of the Android SDK with Xamarin- you can always use the Android SDK manager to update the SDK and I’ve never had that break my Xamarin projects.

    And yes, GenyMotion works great with Xamarin Studio- I never use the emulator from the Android SDK.

    As far as cross-platform development, you can reap great benefits from using Xamarin for both Android and iOS if your app is designed so that the UI is separated from the rest of the app (think MVC, MVVM, three tier-architecture, or some other architecture that separates the UI and eliminates dependencies on UI code.) With this kind of architecture you will still have two different projects for Android and iOS (and you could also have projects for Windows, Mac, Linux, etc.) But the projects will share all the code except the UI code. So, you only write your logic and back end code once.

Add a comment

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s