Xamarin as a product has always delighted me. Imagine writing cross platform native mobile apps with your favorite programming language, C#. As a developer you feel proud that your code is running on more than billion devices world wide. To add icing on the cake frameworks like MvvmCross and CrossLight enables the devs to share more than 60% of their codebase across the platforms. These frameworks provides plugins for common scenarios of mobile development like GPS,Camera,Navigation etc. The only code that remain distinct to the platform specific is UI code. and believe me this was tuff task. On Android you have to deal with XML and on iOS it was XCode proprietary drag and drop styles for creating the UI. But when Xamarin came out with version 3.0 things changed at that front also. Among many other cool features released with the latest version my personal favorite was Xamarin Forms. This is the awesome library where by which you can create mobile apps by almost sharing 90% of your code base. Yes and this includes the UI part also. At runtime the library will generate native UI for each platform.
You have two options to share the UI code
- Create UI with XAML markup
- Create UI with code behind.
Xamarin Forms supports Windows Phone 8 also.
The code sharing approach can be achieved via Portable class library (PCL) or Shared Project. If you intend to use XAML for your UI then you need to use PCL only.
The library is fully extensible. If you wish to write any platform specific code then you can use Dependency Service and if you want to render custom UI for any platform then you can use custom renderers for the same.
MVVM pattern is supported out of the box. Just set up your INotifyPropertyChanged interface and you are good to go. It has full support of data binding, Command and Messenger. If you don’t want to use built in classes then you can hook up any MVVM Framework. In fact Laurent Bugnion has a very good post about using MvvmLight Toolkit.
The community is quite actively involved in contributing add-ons for Xamarin Forms . Two projects which I’m following very closely are
GIVE ME MORE
Xamarin Forms popularity has really shooted up rocket high. But as a developer this is my wish list
- Provide Xaml Ui Designer , something very similar to Expression Blend . At the time of writing this post only Xamarin Studio supports bit of intellisense for XAML markup.
- Start support for Windows Store apps (Windows 8.1 and Windows Phone 8.1)
- Similar to maps and SQLite database , provide support for push notifications for all the platforms via common code base.
- Provide a converter tool which can parse XAML and convert to C# code and vice versa.
- Provide better code refactoring tools like Resharper for Xamarin Studio.
I know I may be quite demanding :). This library has a great potential and can be eventually become a game changer. Let us wait for Evolve conference what announcements Xamarin makes for this great library.