Strategies for Developing Cross Platform Apps
Created: 04/06/2015 by Roberto De Simone
App development is indispensable for every enterprise. Today at least Android and iOS have to be supported. And, also don’t forget the web - a lot of people like to access a service through the web browser. This created a market for tool makers to simplify the cross platform development. This blog will examine some tools and concepts.
The need for cross platform development tools
The heterogeneous environments, cost pressure, maintenance problems and lack of manpower together with a wide range of skills created a market for cross platform development tools. [Along with the user interface development which is the topic of this blog, there is also the need to define a backend strategy which can support and facilitate the app developement. Web Services (APIs) and Cloud Services are part of this strategy.]
Tools and concepts for developing apps
In my opinion, these are actually the most popular tools/concepts (of course there exist more):
- Native Tools
- Hybrid Apps (apps with a native frame and multiple WebViews)
- Cordova/PhoneGap Apps
- (React Native/NativeScript)
The following chart tries to position the resulting apps developed with the mentioned tools or concepts regarding quality and software development productivity, if several platforms have to be supported. Nevertheless, in the end the positioning depends on one’s programming skills and how familiar somebody is with the tool he/she uses.
(An additional note is needed for React Native: the positioning of React Native is at the moment only an assumption after doing some first trials. The tool gets actually a lot of attention and the concept is very promising, so it cannot be left out).
An enterprise with enough budget and staff looking for the maximum result and independence from third party libraries still decides to develop with the native tools. Security issues might also play an important role. Mostly, for each platform an own development team is needed. It is obvious that this is a very expensive approach under every aspect.
With the help of Mono, an implementation of the .NET runtime which is bundled with the app, all native APIs (iOS/Android) are mapped in order to be used with C#. The bundling of Mono with the app is also the reason why the size of a Xamarin app is bigger than an app developed with the native tools. See this link explanations. App size is somehow an issue - in my opinion apps should be as small as possible. But still the app size can be accepted. Compared to the development with the native tools, only one programming language has to be learned. Theoretically everything that is possible to do with Objective-C/Swift or Java can be done with C#. But the extensive learning of the various APIs and the operating system concepts cannot be avoided. Xamarin started with a “learn once - develop anywhere” approach. With the introduction of Xamarin Forms, a layer on top of Xamarin was added. In theory this allows the “develop once - run everywhere” approach. In practice Xamarin Forms still needs specific code for each operating system. Xamarin Forms will evolve, and in the future a single code base might be realistic. The quality of Xamarin apps is high because they are fully native. There is also to remark positively that Xamarin is well established in the market and continuity is guaranteed (a problem of continuously changing web frameworks).
Hybrid Apps are a combination of native code and web code. The general idea is to use a native frame - header, footer, tabs, menus and page transition are all done with native code. The content of a page will be web technology - each page has an own WebView. This concept still needs skills of the native tools. Additionally multiple projects have to be maintained. For the browser, hybrid apps offer great synergies because mainly “only” a new frame has to be developed.
When it comes to decide which tools should be used, there are always several external factors which have to be taken under consideration like budget, staff, existing apps and IT organization.
From a quality point of view an approach which uses native APIs leads to a better result. The native development tools are still the tools of choice if it comes to reach the best possible user experience and being independent from third party libraries.
Xamarin is very interesting in cases where already a lot of C# .NET knowledge is available, and by the time Xamarin Forms evolves further.
A combination of native code and web code (hybrid apps) might also be very interesting; it provides a lot of synergies if the browser shall be supported as well - high quality apps can be created. As a disadvantage I consider that native and web knowledge are required. Compared to a Cordova app significantly more development effort is needed.
From a productive point of view Cordova is unbeatable at the moment. If additionally the browser shall be supported, the productive gain is even higher. Especially for enterprise developments these are very strong arguments!