How Xamarin is empowering developers to create better mobile apps

DevToolsGuy / Monday, March 30, 2015

In the old days it was easy to develop applications. There was a machine on the developer’s desktop and it was fairly clear how that machine would behave in all circumstances. Even later, when every application began being targeted at web development it wasn't that hard because code would be on a single web server and (by and large) the code did what you expected it to do. And then there was the mobile revolution. Developers needed to create apps that would behave in a normal way at any time and on any device.

And this is something which every developer continues to struggle with. Developing for mobile devices isn't easy: there is not only the fact that there are three main platforms - each with their own SDK's - but there are also many more devices and variations in screen sizes, orientations, amount of memory, different specifications and so on. To handle all this in code is a real challenge. Due to the relatively low level programming on mobile devices, developers get a lot of freedom and flexibility but that freedom also has a price because the developer is responsible for more work to handle things like touch and swipe gestures, radio and accelerometer data, camera and video hardware, etc.

Even the management and transition between screens when data is involved is far from a simple matter. Developing a native mobile application takes a lot more time than developing the same functionality for a desktop or a web application. Nowadays a developer no longer has to modify design and custom code to different platforms or systems. Xamarin lets you write mobile apps on any platform using C#. In this post we’ll take a look at three ways in which Xamarin can help.

1. Single development language

Becoming an effective mobile application developer always involves a learning curve. There are things like process lifecycle, UI norms, the platform SDK (to name but a few things) that you must learn. If developing on a new platform also involves learning a completely new language, you’ll be faced with a particularly steep curve. Xamarin applications are written in C# however, and any experienced .NET/C# developer will be immediately at home working with Xamarin.

Xamarin provides a complete implementation of C# and the .NET class libraries. It’s not uncommon for well over 80 percent of one’s existing desktop or server .NET/C# code to be compatible with Xamarin. Even inexperienced .NET/C# developers will likely reduce the time they spend learning. Meanwhile, Android and iOS normally require the use of two separate programming environments: Java and Objective-C respectively and very few developers are highly skilled in both of these environments which means the overwhelming majority of developers will have to learn one or both of these environments before beginning a cross-platform project. Learning the Java and Objective-C environments is not limited to just the programming languages. There’s also the issue of the underlying core classes such as collections, that will require you to understand two different ways of doing the same things.

Using Xamarin, you only need to learn one language - C# - and one core set of classes to be effective on both platforms.

2. One code, making the most of different systems

Writing the application in one language for different systems does not lead to the loss of functionality. Some cross platform application development tools often hide the platform’s unique functions thus leading to applications that just don’t feel native on different devices. Xamarin, however, adds the iOS specific .NET classes and Android specific .NET classes to the existing .NET classes. This combination of code .NET and platform specific classes allows the developer to write applications that share logic between the platforms but still take advantage of the platform’s unique features. The more code that can be shared the less likely it is that bugs will appear in the code and the faster the developer can write the application. According to Xamarin you get the chance to reuse 60 to 80 percent of your code and this cuts development time in half. The time you save here is valuable and can be invested into new features for the application.

Test your code on thousands of devices in the cloud

Writing a multi-platform application is one thing. Testing it on a wide range of devices is another. It’s possible that a developer will have access to an iOS, Android and Windows Phone but what about all the different configurations like screen size, resolution, memory and so on? Xamarin offers developers a test cloud. This is an automated user-interface testing service that is designed to enable mobile developers to test their apps on hundreds of mobile devices. With the test cloud, developers are able to test their applications on real devices, not emulated ones. The tests run on these devices provides the users with detailed logs and screenshot about how the app performed on each device.

The unifier

Xamarin is gaining more attention everyday and with good reason. In a world where a variety of mobile platforms coexist, we need a development tool that allows developers to support multiple platforms with minimal duplication of work. With Xamarin.Forms you even get a complete UI design tool that can build cross platform mobile applications. Using Xamarin will lead to a shorter development cycle due to the C# and .NET implementation, the reusable code and the availability of a test cloud. This is something every developer must take a look at.