Why Is Cross-Development So Important for Mobile Applications?
Nine out of 10 mobile devices run either Android or iOS operating systems. They share that 90 percent more or less equally. A half dozen other OS’s, including Windows Phone, fill out the remaining 10 percent. Given that there are mobile devices in the hands of about 2.5 billion people today, to ignore either Android or iOS for your consumer-level mobile app development is essentially writing off over a billion devices. Nor is it wise to write off Windows Phone’s growing market share.
At one time, enterprises thought they could ignore that math, since their IT ecosystems were essentially closed. However, the undeniable trend now is to support BYOD – Bring-Your-Own-Device – for an increasingly mobile workforce and customer base. No longer can the enterprise afford to dictate one platform over another for all B2C and B2B applications.
The Promise of Write-Once, Run Everywhere
This is where cross-platform development comes in. Developing consumer or business apps for multiple operating systems would be intensely resource-consuming if you had to write, test and support more than one app version for every platform separately. If you were to write natively for Android, iOS and Windows, for example, then your development teams need to know Java, Objective-C and C#, respectively.
Alternatively, cross-platform tools allow, to a varying degree, writing the app once and then compiling the code for each platform the development environment supports.
Potential Disadvantages to Cross-Development
Using cross-development tools to gain more platform market share is not without drawbacks however:
- Cross-development environments may take a lowest common denominator approach that cannot take advantage of each device’s native performance or native look-and-feel.
- Startup times are slightly slower due to having to load runtimes or libraries.
- Possibly there will be increased debugging due to the extra layer of abstraction required.
- App updates will have a longer lag time at each new OS release waiting for the cross-development IDE vendor to update APIs.
- Cross-development environments are not free.
Despite these issues, these tools have come a long way, continue to improve and are enjoying growing adoption.
Three Existing Approaches to Mobile App Cross-Development
OSs, like cats, can be skinned in multiple ways. Three of the most popular cross-development environments each take a different approach.
Xamarin allows developers to write their apps in C#, which is then complied for each supported platform. Using APIs that interface directly with each platform’s native APIs, Xamarin claims that apps achieve a native look-and-feel plus native performance.
- Supports Android, iOS and Windows.
- Compiled code is platform specific, so it can achieve high performance, use native hardware acceleration, device features and native UI components.
- One version plugs directly into Microsoft Visual Studio. For reduced cost, Xamarin Studio can be used instead.
- One language, C#, is used to develop for all platforms supported.
- Code can be reused between client and server sides.
- Xamarin.Forms can be used to design platform-specific UIs.
- From 60 to 100 percent code reuse is possible.
- There is a learning curve for those unfamiliar with C# and .NET programming.
- Xamarin.Forms results in a lowest common denominator UI, but customization is possible.
- Load times are slightly slower as the Xamarin runtime must be loaded at invocation.
- Business level license is $999 per year.
PhoneGap takes a different approach to cross-platform development than Xamarin by requiring that apps run within the platform web browser.
- Supports iOS, Android, Windows, Blackberry, Firefox OS and others.
- A single, standard API works across all device platforms.
- 100 percent of code reuse is possible.
- Given that there is a layer of indirection at runtime via the browser, performance and the UI suffer compared to a native app.
- Supports Android and iOS.
- The resulting UI look-and-feel is close to native.
- 100 percent code reuse is possible if you do not program for native UI.
- Trying it out is free.
- Only supports UI features that are common across all platforms.
- Developers must learn the Titanium API.
- There is a small delay at app startup due to library loading.
- Requires hefty licensing fees for deployed apps.
Each of the cross-development platforms above have their individual strengths and weaknesses. None is a clear winner over the other yet. Which one you choose as an individual or organization depends on your requirements for app performance, look-and-feel and how comfortable your current development staff is with a particular language or IDE. You should also take into account testability and the level of code reuse you wish to obtain.