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 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
- 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.
- I have JDK 7 up and running, yet Xamarin wants JDK 6. Looks a little strange to me.
- 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.
- I don’t need NDK either, because I don’t use native C in my work.
- 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:
- 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.
- Xamarin Studio works with 4.0.3 SDK and below, which seems to be outdated (4.4.2 is available via SDK Manager).
- 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.
- Xamarin doesn’t support build systems like Gradle.
- 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.