YOU ARE AT:Opinion10 questions to ask before starting a Xamarin project

10 questions to ask before starting a Xamarin project

The mobile application space remains a hot market for developers looking to tap into growing consumer demand for mobile-based services. For developers, one of the main challenges is in trying to write applications that are compatible with the various mobile operating systems in order to reach a larger audience.

An ideal solution would solve this “write once” dilemma by allowing those developers to port their code across multiple platforms, something that a number of platforms have attempted to provide. Valentin Bazarevsky, senior software developer at Itransition, provides insight into 10 questions developers need to ask before using one such platform.

The goal with mobile applications is to always achieve faster delivery to market and lower development costs without losing quality. Cross-platform mobile development with Xamarin seems to offer all those benefits, but still remains a hot topic and a point of contention for a lot of developers. Therefore, it is vital to remember what questions one should ask about going cross-platform.

Code once or code three times?
Making a popular app is not easy, so ideally the users of all three popular platforms should be included. The question here is: code once or code three times? To write the app three times, three teams of experts for each platform are required; to write it once, cross-platform developers with impressive skills must be hired.

The decision to go cross-platform will largely depend on what type of app is being developed. Is it a game, map or a customized enterprise app? For games and maps, there is not much difference between the three platforms. Enterprise apps, however, demand high quality and require a native look and feel. That’s where Xamarin CPMD teams can come in handy.

What types of apps fit well with CPMD in general?
The amount of logic and algorithms an app entails also will determine the choice in favor of CPMD, as apps that require a lot of logic and complicated algorithms are ideal candidates. A platform abstraction layer free from platform specifics is developed, extension points are written and native controls are added to offer the look and feel users expect on devices of different dimensions. As a result, even though the app is not 100% native, part of the code is, and there is native realization of user interface, or connection to the network, which makes the app indistinguishable from a native one. For that reason, CPMD may help combat the problem of device fragmentation.

CPMD tools allow for writing code once and tweaking it for each platform. Developing a solid PAL and a cross-platform architecture may presuppose more time and money, but when compared to the price of writing three separate codes, time and financial savings are quite possible.

Can code be reused for different platforms?
Code reuse for applications on different mobile platforms is an efficient way to save time and money. Code can be reused if the app has a lot of logic and algorithms for decision-making – a lot of work with the local database, for example. A perfect project for code reuse is one with a lot of work with a server that can be cross-platform to develop an application programming interface client; and lots of work and synchronization with the local database, server and local mobile part. UI can never be developed with CPMD tools, so on projects light on UI, CPMD tools work best. With Xamarin-project specifics, up to 80% of code may be reused.

Can business logic be shared between mobile and server parts of the app?
Sharing business logic on mobile and server levels using the same code base is important. If a project features a server exchanging data through a REST protocol, the API-first approach is applied where everything works through the API. Every module in a server gives its own API, and every other module reaches this API. To achieve this, one needs an API client that can be used both on the server and the mobile part, so Xamarin tools can be used to speed up development.

Can the native level of mobile app performance be reached?
Comparable performance with native mobile applications can be achieved using OpenKode specification implementations like Marmalade SDK or Xamarin. Both approaches use static compilation, which means putting an app on the device with a processor instruction, boasting performance as excellent as a native app. When it comes to the much contested possibility of achieving a native look and feel, it is not a problem for experienced CPMD teams who stay on top of new developments in every mobile platform.

What about third-party libraries?
Support of third-party libraries can be done in two ways: by using dependency injection or wrapper patterns. Different cross-platform frameworks solve the issue of third-party libraries in different ways. For instance, Xamarin allows both: injecting dependencies or covering native libraries via binding classes.

How will the project be supported and tested?
Access to portable class libraries on Xamarin projects allows the use of a common server infrastructure with .NET projects for continuous integration, deployment and inspection. Moreover, platform-independent C# code could be more easily covered with unit and integrations tests. In addition, C# provides a wider usage of techniques like collective code ownership or cross-team code reviews, even if mobile parts are small compared to the whole project.

Complex .NET business projects: Is integration with infrastructure easy?
Complex business projects written on Xamarin can be easily integrated with server infrastructure. Because Xamarin is based on .NET, it is possible to use development tools that the server developers use. There is a wider choice of tools and services available that allow for continuous deployment and integration.

Can developers without mobile development experience be hired?
Xamarin projects offer the ability to delegate business logic implementation to server developers without a mobile development specialization. A well-documented PAL enables developers to use a wide range of server development tools, which means that server developers without mobile experience can be involved in CPMD projects without losing the high level of quality.

Are there experienced knowledge continuity experts?
CPMD is a dynamic field of IT where changes occur constantly. It demands a higher qualification of developers and careful attention to current innovations in each mobile platform. Following Xamarin’s blog and liaising with CPMD knowledge experts for continuous education and training can ensure success.

Valentin Bazarevsky is a senior software developer at Itransition. He received an M.A. in computer science from Belarusian State University of Informatics and is currently working on his Ph.D. His main areas of interest are .NET, iOS Objective-C and Microsoft Silverlight, as well as data analysis techniques for high-load distributed systems, mobile platforms (cross-platform vs. native) and machine learning.

ABOUT AUTHOR