header small transparent
  • STARTSEITE
  • PROJEKTE
    • Referenzen
  • LEISTUNGEN
  • SCHWERPUNKT
  • ÜBER UNS
    • UNSER ANGEBOT
    • UNSERE UNTERNEHMENSLEITUNG
  • Blog @ DEVBRAIN
  • KARRIERE
  • KONTAKT

All you need to know about Xamarin

4. June 2019Piet UbrichCoding, SPANo Comments

What problem does Xamarin solve?

In the last century mobile applications have become almost inevitable for most of our software solutions today. For almost every service out there, our customers will also have the demand of a mobile app. Now, you could develop an android app, and be done with it. But you would lose a lot of potential customers that dwell on iOS. This would mean a huge financial loss and is unacceptable for most companies. The result are two separate mobile applications: one for Android and one for iOS.

Let’s say, our customer has a team that is used to the Microsoft .NET stack and used ASP.NET applications until now. Sadly, these applications require different programming languages: Java for Android and Swift for iOS. Hiring a completely new team or even teaching these languages to the existing team can be really time consuming and thus expensive. The engineering effort to create and maintain these applications is immense and they can not share any code. When a bug is fixed in one application, this must be done in each of the application projects.

How does Xamarin attempt to solve this problem?

The idea of Xamarin is to develop mobile applications for the various operating systems using only the .NET framework on the developer’s side. They provide the Xamarin.Android framework for Android and the Xamarin.iOS framework for iOS. These frameworks provide a mapping to the device specific controls and functions and makes them accessible in your .NET code. During the build process the compiler will turn these mappings into native code for the specific device. This allows for native performance in comparison with other cross-platform solutions, e.g. Progressive Web Apps or Apache Cordova (aka. PhoneGap).

At this point we still have multiple, separate applications that need to be maintained, but we reduced the technology stack to the .NET Framework. The developers can use either C# or F# to develop these applications inside either Visual Studio, Microsoft infamous IDE, or Xamarin Studio, a specialized IDE for Xamarin development. Not only can these teams use the programming language that they are experienced with, but also the .NET libraries that they are familiar with, e.g. Entity Framework. These will work straight away and handle exactly as on a regular Windows or Linux machine.

Another benefit of using only .NET in your mobile applications is the possibility to share code between them. If they handle similar data or use similar business logic, you can extract them in a shared library and reuse them in all your applications.

Xamarin.Forms

You could say that the development process is now a lot easier and the maintenance cost is extremely reduced, and you wouldn’t be wrong about that. The reality is that you still need to maintain different user interfaces for each of the operating systems.

That is where Xamarin.Forms comes into the play: It provides a .NET library with a lot of UI components that can be used inside your projects. These components have bindings to the native components for that specific device. This allows us to develop a single mobile application and compile native applications for each operating system without any extra work. These can be deployed on any device and use the devices layout, e.g. on Android the scroll bar will be rendered differently than on iOS. Using this library your mobile applications might as well reach 100% code-sharing between the different platforms.

What about complex components?

For most applications the Xamarin.Forms library provides enough templates and components to fulfil their needs. If you want or need to have more fine-grained control over your layout and behaviour, it might be unavoidable to use custom implementations using the Xamarin.Android and Xamarin.iOS SDKs. These give you full control of how you want the components to behave on just that specific operating system.

Visual Studio App Center (previously Xamarin Test Cloud)

The mobile device market is so diverse that testing for all kinds of different devices can be tedious and can cost a lot of money when using physical devices. Several emulators are available for virtual testing, but this won’t reveal all the errors that could happen on specific devices.

For this purpose, Xamarin created the Xamarin Test Cloud which was later integrated in the Visual Studio App Center. This allows a team to continuously build, test, release and monitor apps for multiple platforms, including Xamarin. But instead of just executing your tests on emulators you can choose to test your application on thousands of real devices to see how your application behaves under realistic circumstances.

What is the Xamarin Component Store?

Xamarin used to offer a platform where complex components that were already created could be acquired, but it was discontinued in May 15, 2018.

Summary

When working with a team that is experienced in the .NET ecosystem and the support of Android or iOS apps is required, Xamarin is the perfect framework for the job. It helps us to fully utilize the existing knowledge and increase maintainability for all applications.

Tags: .Net, .NET Framework, C#, Code-sharing, Cross-platform, F#, Microsoft .NET, Mobile, Testing, Xamarin
Piet Ubrich
Piet ist bei der Devbrain IT Solutions als IT Consultant mit Schwerpunkt auf Microsoft Technologien tätig. Er absolvierte eine betriebliche Ausbildung zum mathematisch-technischen Software-Entwickler an dem Oberstufenzentrum für Medizin- und Informationstechnik in Berlin. Währenddessen arbeitete er als Full-Stack Entwickler bei einem Softwarehaus in der Produktentwicklung für Industrie 4.0 Anwendungen. Er ist Microsoft Certified Solutions Developer (MCSD) und hat bereits viele Erfahrungen mit Microsoft Technologien sammeln können.
Previous post Hibernate-Anbindung an einen Rest-Service (Java) Next post Unit Testing in Vue.js

Leave a Reply Cancel reply

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

Recent Posts

  • Deliberate Programming
  • Cross-platform code-sharing in Vue.js
  • Unit Testing in Vue.js
  • All you need to know about Xamarin
  • Hibernate-Anbindung an einen Rest-Service (Java)

Recent Comments

    Archives

    • July 2019
    • June 2019
    • May 2019
    • April 2017
    • January 2017
    Burckhardtstraße 1 - 30163 Hannover
    +49 (0) 511 940 85 245 | +49 (0) 176 234 477 67
    info@devbrain-it.de

    Informationen

    kununu
    • Impressum
    • Datenschutz
    © 2020 DEVBRAIN IT SOLUTIONS GmbH

    Kontakt

    Email
    Facebook
    YouTube