Hacker News new | ask | show | jobs
by fidotron 4371 days ago
The killer problem with Xamarin is to use it effectively you have to be expert in both Xamarin and the native platform you're targeting. This is because most of the work of mobile apps ends up being tied to the UI, which has a platform specific API.

If your app happens to deviate from this, then at least for Android once more you're in platform specific land (for example, services), but I've seen people doing things like rolling their own ghetto mini database in C# to give themselves a portable data model, when it would be faster to use SQLite on Android and iOS, just to justify the decision to use Xamarin at all.

So, it can work, but people have a tendency to greatly overestimate how much of a mobile app can actually be platform independent anyway. Games are a different proposition, and this is one reason why Unity has cleaned up.

2 comments

YMMV but for me, there was not 'learning' of Xamarin. There really is no Xamarin framework - there is the mobile frameworks themselves for which there is an almost 1:1 translation. CalculateFoo in ObjC or Java will in nearly every case be CalculateFoo in C#. In the cases where the recommended method is to use a higher level abstraction (like for table data in iOS), the option to use a mirror of the ObjC pattern is there but there is an easier approach available if you choose that.

The key for me was understanding the idiosyncrasies of both Android and iOS and their patterns and then using C# to craft as much reusable code as possible. It drives my approach and I failed to get the re-use level I wanted on my first true cross platform app build, but since I have learned those lessons I have gotten much better at it.

(note: I have yet to use Xamarin.Forms, this experience is based on Xamarin in the past 15 months)

The power of Xamarin is obviously that you have a single language (C#) even if you have a "fat" UI's that are platform specific. Having a single language means that you can have your business logic as a single code base rather than it in two or more languages with all the consequences of code base specific bugs.

But I do agree with you, Xamarin is not a build once run anywhere kind of solution. If you want to build Android app with it you still need to be very familiar with all the ins and outs of Android, same for iOS.