laptop

Xamarin for Android/iOS programs

Xamarin is a toolkit that provides high-performance compiled code with full access to all its own APIs. This allows you to create native applications with a device-specific interface. Anything you can do in Objective-C or Java, you can do in C# with Xamarin.

While you can use Xamarin Studio to develop apps, you can also use Visual Studio and all the other tools you already use for C# development today. This includes Team Foundation Server (for source management) and plugins such as Resharper, GhostDoc, etc.

From a developer’s perspective, Xamarin offers three main products – Xamarin.Mac, Xamarin.iOS (MonoTouch.dll), and Xamarin.Android (Mono.Android.dll). All of them are based on Mono, an open source version of the Microsoft .NET Framework. In fact, Mono was originally created by Miguel De Icaza, co-founder and current CTO of Xamarin.

On iOS, a special compiler compiles C# apps directly into ARM’s native code. For Android, this process is similar to compiling and executing .NET. The source code is compiled into an intermediate language (IL). When the code is executed on the device, a second compilation (performed just in time) compiles the IL code to native code. This makes sense because Android apps are developed in Java, which has an internal architecture similar to that of the .NET Framework.

In most cases, you don’t need to worry about memory management, resource allocation, etc. because everything is handled by the runtime environment that Xamarin provides. However, there are cases where you need to be aware of what’s going on, such as interacting with Objective-C. This can create save loops or where your managed class will actually wrap some expensive resources, such as UIImage on iOS.

There are special considerations for iOS apps. While Xamarin Studio on Mac provides everything you need for iOS development, Visual Studio users on PC will still need a Mac with the Xamarin tools installed. This allows you to compile your apps over the network and test them on an iOS simulator or iOS device.

Xamarin allows you to build iOS and Android apps with C# or F#, but using the traditional Model-View-Controller pattern. If you want to improve testing, maintainability, and portability, you need a way to port the MVVM pattern to these platforms.