Up until very recently, mobile developers had to be in either the iOS, Android, or Windows camps. Software development for each of these platforms was entirely different with their own ecosystems, languages, and styles.
Xamarin has changed that. As they say: > Xamarin enables developers to create applications for iOS and Android with C# and the .NET libraries. On each platform, the developer can use the full spectrum of native APIs and user interface controls that are made available by the underlying operating system and hardware.
Why use Xamarin?
Traditional mobile development either requires separate codebases for each device, or your app can be built to run via the web browser. The issue with the first is obvious, maintenance and cost are a nightmare. iOS development requires you to know Objective-C, Android uses Java, and Windows Phones use C#.
The issue with web browser apps on mobile devices is that they don't run natively. The UI doesn't match the familiarity of the device, and performance can also be an issue as you are not using native code.
How does it work?
Xamarin allows you to create individual UIs for each device, but share the common core application code across all of them.
Creating the UI is done using Xamarin Studio (Visual Studio developers also have access to the UI libraries for Android and Windows devices). You build a UI for each device using the drag-drop toolkit. Xamarin Studio also allows you to test the UI on multiple screen resolutions and orientations too.
The core codebase, the parts which hold all your business logic and data access, is done once, and once only using Xamarin. You have access to all of the devices APIs so you can access the camera, wi-fi, other apps, and whatever you normally would be able to when developing natively.
Xamarin compiles your code and the UI into native binaries for each specific device. For example, your iOS version will output a binary .APP file which you can submit to the iTunes Store, and your Android version will produce a .APK file for you. The real gotchya with this though, is that Apple requires you to compile your code using a Mac device. So if you're a Windows developer wanting to write an iPhone app, you're out of luck unless you pony up the cash for a cheap Mac.
Why should you use it?
Three primary reasons why Xamarin is great are:
- Native UI for each device makes your app more familiar to users.
- Native performance using the devices individual APIs.
- A shared codebase across all devices.
Of course, if you're already a .NET / C# developer and doing mobile development, it makes sense to use those skills to get your app running on multiple devices.
How to get started
There is a free starter edition of Xamarin which will give you all you need to get started. Once you've set that up, work through some of the many tutorials and samples online. Xamarin themselves have quite solid guides available.
I've included some below which I initially found useful: