My Xamarin experience and why I would not recommend it.

Today I decided finally to share my 6 months experience on Xamarin development, having background in Android native development.


Preface

We(2 developers) were responsible for developing Android application in Xamarin. There was a 3 layered iOS application and we had to reuse Data and Domain layers. That’s the reason why they have chosen Xamarin (i guess). That looked pretty interesting at first sight! But later we found that wasn’t so easy.


Disadvantages

I will try to enumerate all problems I saw in Xamarin. It’s possible that some of them are not more relevant as my experience was in late 2016.

Updates

In native development we used to update SDK to latest versions. Updating Xamarin was a really bad idea ! I’m not sure that we had any update without problems. Every update led to “broken” environment and we were not able to “build” solution. Several hours(or days) spent and we solved that problem.

After several updates, we decided to not update anymore.

IDE && build time

This was the reason why development took more as expected. In native development we used Android Studio based on Intellij Platform which worked amazing(if you have enough RAM and SSD).

Build time was pretty big. It took up to 2 minutes to build and run an application. At the same time, native application of same complexity will build and run in ~ 15 seconds.

Choosing IDE we had two alternatives:

  • Visual Studio
  • Xamarin Studio(which was deprecated for Windows! but we used it anyway as it was more stable)

Visual Studio

Pros

  • Good for coding (because of Resharper)
  • Cool debugger
  • And more other VS cool things…

Cons

  • Constant blocks/freezes during build time and “Visual Studio is busy” messages.
  • Shit XML intellisense for Android Resources XML (layout, colors, themes and others). I would say that this is not present at all, we experienced Notepad experience. As Android we used to write XML directly and that was an important point.
  • Shit Designer — as we had a shit XML experience, we tried Designer, which was another disappointment

Xamarin Studio

Pros

  • Was stable comparing to VS. No blocks and freezes during build time.
  • Has a better XML support. Far away from Android Studio, but much better than Visual Studio.

Cons

  • Average coding experience. I was missing JetBrains refactoring tools.

Native library porting

That’s not a surprise that porting a native library to Xamarin is not a easy task. I spent days by trying to port some native libraries. Some of them succeeded, some of them not.

Community

Community is much smaller comparing to native development. In case you have problems(i’m sure you’ll have) than it will be hard to find solution for this.


Advantages

Use .NET developers

Theory says that you could use .NET developers if you have them.

Cross platform

This allows you to have a common code for both platforms. But not so easy ! The iOS and Android application should be written at the same time, otherwise you’ll have problems with reusing this common code.


Conclusion (reasons why I would not use it)

Android and iOS are very different as a platforms. They have a lot of differences like :

  • Architecture
  • User Experience
  • Application/Screen lifecycles

I still don’t believe in Cross Platforms and I would probably stick to native development. I would say that the price for developing Xamarin app is bigger than native application. So, it’s not worthy !

Google invests a lot in Android development. At the time we developed application, Android Studio with Constraints Layout was released(i don’t know if that will be present in Xamarin at all, although this is a really cool thing). Their Designer was fully rewritten and replaced. There are a lot of native libraries which simplifies your work. If you hate Java, There is Kotlin ! Kotlin allows you to avoid “Java/Android compatibility” and use cool features like null safety, lambdas, stream and other cool things.

If you have .NET developer, you will anyway need to invest in them to learn platform specific.

Native apps works much faster and stable than cross platform apps. If you care about performance and experience, than you should stick to native apps.

Finally, we spent 6 months only for presentation layer. I think we could spent 3 months doing all 3 layers native and obtain a faster and more stable application.