Xamarin Forms, the love of cross platform native UI

Some months ago, I started a small project for a friend: a basic app for managing stock. A personnal project is always a good occasion for testing a new tech, and Xamarin was in my radar since a long time. With Xamarin Forms I was able to make an app with a native look & feel without having to bother with interface. Let see how it goes!

Using Xamarin you code in C# and you can make apps for iOS, Android and Windows Phone. Unfortunately, not everything is cross platform: you can share code between platforms but not view. Making apps for iOS, you will use Xcode and Storyboards. Xamarin will be able to handle them on its side, but you understand that the Android target can’t. So basically, If you make a pure Xamarin project you have to architecture your project in a way that you could use Data & Model codes accross platform but implement different views. This is not perfect, but it’s way quicker than making two different native projects.

Xamarin Forms is an other story. You won’t use Xcode to make your interface, you will write interface code directly (which is cross platform) or XAML files. For Flex developer, this is somehow similar to MXML. In a first look, Xamarin Forms seems to be perfect. The API is evolving in the right direction and the community is growing. There is a good support on the forum. But when you go a bit deeper, you see there are still a lot of work to do:

  • no simple way to select an image from your phone
  • no simple way to take a photo
  • no video support (with cross platform code)
  • no calendar support etc.

The basics are covered by the Xamarin Forms API, but if you make an app with many UI features you will have to check the Labs. Without any doubts, that will be merge sooner or later directy in the Forms API but at the moment it isn’t stable enough.
Also it’s important to test often on iOS & Android because you can be surprised. If you specified your text to be in black it won’t be visible on Android since its default behavior has a dark background whereas iOS is white. Obviously you can specify properties per platform, but it includes lots of testing.

Xamarin Studio is the IDE based on a fork of MonoDevelop. Making several Unity projects I’m used to code with MonoDevelop and managing its errors/bugs. In a first look, Xamarin Studio looks strong, by the way Unity is also making a plugin to be able to use it. But why does sometimes when I launch my project I’ve to close it and open it again because it is not able to build it? Also is it that hard to successfully connect to iOS simulator? It works 1/5, that’s so painful. And it takes me hours to be able to import/clone my project on an other machine… and I won’t speak about the lauching/opening project time, it makes Eclipse feeling like a race car! But well, that might be the best IDE to make C# on Mac at the moment.

You can check my code here. I enjoyed working with Xamarin despite the declarations above, it just needs a bit more maturity and fixing those damn basic IDE bugs.

But psst, I heard a new kid is coming on stage, and it’s acting like a Fuse.

Leave a Reply

Your email address will not be published. Required fields are marked *