David Chappell


Get the Feed! Subscribe

A Perspective on Xamarin  
# Friday, February 28, 2014
I've been looking at Xamarin recently, a company that provides technology to build apps for iOS, Android, Windows Phone, and other platforms. The diagram below summarizes one way to think about their offering compared to other popular alternatives. (Click on the diagram for a more readable version.)

Suppose you want to create an app that runs on iOS, Android, and Windows Phone. One way to do this is to create a portable HTML5/JavaScript app. As the diagram's first row shows, this lets you work in just one language and build just one app. These benefits (shown in green) are balanced by some significant limitations (shown in red). HTML5/JavaScript apps provide only a generic web-based user interface rather than a native UI for each device, and they allow only limited access to native functions on the device, such as the camera. They also can't be in app stores--you've got to find some other way to distribute them.

An alternative is to create a native app for each platform, as shown in the diagram's second row. This requires working in three languages to create three different apps, which is significantly more complicated, but it has some real advantages. Your app can now have a native user interface for each device, and it can fully access whatever functions the device provides. Native apps can also, of course, be in app stores.

Both of these approaches have some green aspects and some red aspects--pros and cons. Wouldn't it be nice if there was a solution that included only the green from both options? This is what Xamarin aspires to.

With Xamarin, you build one app in one language--C#--giving you a single main codebase. But you also customize this app for each platform. You create a native UI for each device, for example, and your app can access whatever device-specific functions it needs. The result can also be in the various vendor's app stores.

Even though Xamarin tries to offer the best aspects of the other two approaches, there's still some pain--you aren't really building just one app. Still, you can reuse some (maybe even most) of the app's code across all three platforms, which is likely to simplify the task of creating and maintaining a mobile app.

Xamarin is certainly seeing some success, which suggests that this technology is appealing to a chunk of developers. And in any case, the approach they've taken, providing a middle ground between the two most common options today, is definitely interesting.

4 comments :: Post a Comment



What about hybrid with PhoneGap? How does that relate to Xamarin in your experience?

I'd argue that PhoneGap is more focused on a broader write-once-run-anywhere scenario. PhoneGap apps use web UIs, for example, rather than the native UI style of Xamarin.

If I were ordering the options from most portable/least control to least portable/most control, the list would look like this: HTML5/JavaScript, PhoneGap, Xamarin, native app.

David, the way I see it, basically using Xamarin is only slightly different structurally than using javascript and then implementing a bunch of different browser detections/behaviors (which, fortunately, script libraries are pretty good at handling if you use them). Xamarin is in one language, and whilst you must handle **more** of the device differences, I would expect that there will be libraries or functions that handle a good portion of that.

Another way of saying this is that HTML5/javascript is still not really that much "smoother" since it remains extremely browser fragile; whereas the Xamarin approach still requires you to face that device fragility head on. I don't think your "Number of apps required" is really the right label for that; or the answer to the first row should be something like, "Hopefully 1 to 1.5 apps (after customizations)".

What do you think of that argument?

I think it points out how messy this space is.

I wouldn't argue that my simple categorizations above are the only way to think about this. (I wouldn't even argue that they're the best way to think about it.) I believe it is useful, though, to have some way to organize--and thus to think more clearly about--the options. But it certainly is messy.

Post a Comment

<< Home