A Way Out of the Mobile App Development Conundrum How you can grow your business and improve time-to-market with a cross-platform mobile app strategy
Introduction Ask most any business executive for their topline priorities and before long you ll hear lower costs, increase revenue and improve productivity. Many organizations are targeting mobile devices as a platform to drive growth in these areas. In some cases, for example, a mobile-optimized web presence can help drive traffic and increase revenue. Mobile apps are another great tool to help businesses meet those priorities, but along with the benefits of all these apps come the cost and pressure of designing, developing and managing them: protecting your network from unsecured devices, meeting users relentless demands for an ever-improving app experience and replicating the same experience across the numerous platforms used by employees and customers. 01 Your guide to cross-platform solutions
Introduction (cont.) For example, developers may have to write the same app multiple times for each target platform (ios, Android and Windows), leading to higher costs and the logistical challenge of managing multiple tools, skills and build pipelines. This approach is counterintuitive to companies looking for lower costs, as well as to developers wanting an environment that will help them get more done in less time. Fortunately, there s a way to help alleviate this multi-platform conundrum: cross-platform app development. 02 Your guide to cross-platform solutions
Introduction (cont.) There are numerous factors supporting the use of a cross-platform solution for mobile app development as many developers and corporations can attest. Read on for a quick overview of some of the reasons companies are choosing a cross-platform solution, as well as a side-by-side comparison of some of the technical aspects of Cordova, a hybrid approach that uses HTML and JavaScript, and Xamarin, a crossplatform approach using C#. 03 Your guide to cross-platform solutions
Table of contents Part one: The Rationale for a Cross-Platform Solution Page 6 9: Why would anyone go with cross-platform? Part two: Go Native or Go Hybrid? Page 10 4: App Types at a High Level Part three: Xamarin Versus Cordova Page 14 16: A Comparison of Solutions Page 17: Conclusion 04 Your guide to cross-platform solutions
Part one: The Rationale for a Cross-Platform Solution Reducing the hidden (and unhidden) costs of application development
Part one: Why would anyone go with cross-platform? It all boils down to cost. Sure, a few other reasons exist, but most frequently organizations, and developers, want to lower their total cost of ownership, which is about more than dollars and cents. It includes the value of resources, time and numerous other factors. What follows are a few of the observations that organizations have made while considering cross-platform solutions as part of their mobile apps strategy. 06 Your guide to cross-platform solutions
Part one: Why would anyone go with cross-platform? (cont.) Leverage existing developer skills versus hiring new talent The cost of retraining or hiring specialized developers can be prohibitive. As such, some organizations may want to stick with Cordova (JS), Xamarin (C#), or a C++ solution, which lend themselves toward tapping into a team s existing developer skills. This decision may also need to be considered in light of customer demand, business objectives and other factors. Optimizing and securing personal devices Form factor, features, performance and platform. These are all points of differentiation for personal devices, and organizations should be able to create experiences across the range of these devices cost effectively. Even if an organization uses one sole platform, it s worth thinking about a longer-term objective and the possibility of adding more platform devices at a later stage. Addressing user demands The nature of the public domain suggests that mobile apps be compatible with the widest possible range of devices. Similarly, a developer s choice for a cross-platform or native app solution may be driven by specific needs of the app (e.g., to be highly rated). This means driving the most out of the device and adhering to the user experiences that each platform defines, while maintaining the performance characteristics of the app. 07 Your guide to cross-platform solutions
Part one: Why would anyone go with cross-platform? (cont.) Sharing code across platforms or business channels Sharing code across multiple platforms can help reduce costs, simplify bug management and lead to other benefits. Developers can share multiple layers, the entire app or stick with sharing one, such as business logic. Some organizations also adopt specific technical approaches to share code across their mobile apps and mobile sites. Considering the purpose of the app and its target customer Some base their choice upon the application s purpose, whether supporting an employee or intended for an end customer or other business-to-business opportunity. For example, developers may relax the user experience (UX) requirements of an internal app, in lieu of rapid development, whereas end-consumer apps might require a more highly detailed, pixel-perfect UI. 08 Your guide to cross-platform solutions
Part one: Why would anyone go with cross-platform? (cont.) Accelerating time to market Cross-platform technologies such as Cordova may also be attractive when organizations choose a proof-of-concept solution, an employee-based app or the ability to leverage existing skills. Reducing costs Sharing code, transferring skills, and using familiar tools and app patterns. These are all benefits of a cross-platform solution that helps reduce costs, not just during initial construction but clear through to the tool-chain for developer and IT ops, including build, continuous integration, delivery, release management, and the feedback and analytics cycles. On-the-fly app updates to stores Cross-platform solutions sometimes allow earlier access to a new platform version, platformspecific APIs and the community of open source libraries. And in some cases, JavaScript solutions enable you to perform updates without making a store re-submission, which can involve a large delay. Vendor and community A vendor s size, quality and longevity can play an important factor in which technical solution you choose. The ability to get fast updates, bug fixes, and technical support or community involvement can also impact your decision. 09 Your guide to cross-platform solutions
Part two: Go Native or Go Hybrid? Get a lay of the mobile app landscape
Part two: App Types at a High Level Before diving into cross-platform solutions, here s a general overview of the options for building mobile apps. Pure-native tools and frameworks (XCode for ios, Android Studio for Android) offer a toolchain, app-pattern and UX model. Developers use the relevant tools from each platform vendor. For ios this includes XCode and Objective-C or Swift to construct an app, compile and sign it, and publish to a public or private store. Because the mobile app is native to the platform, it realizes the full performance potential of the OS and can leverage all the device s capabilities. It s designed to adhere to the platform guidelines to optimize the consumer experience. Cross-platform, compiled-to-native tools such as Xamarin and C# give developers the freedom to design and write their apps for ios, Android and Windows using the same language, C#, along with techniques that help compile the app to the native platform targets. 11 Your guide to cross-platform solutions
Part two: App Types at a High Level (cont.) Again, the mobile app is native to the platform, and the experiences are synonymous with a pure native app, offering the same performance, UX characteristics and device-access capabilities. Yet there are some differences with a Xamarin approach: User interface: Xamarin provides native UI designers for ios and Android and allows developers to write the entire mobile app code using C#. A typical Xamarin app developer would create ios and Android UI using the respective UI designers in Xamarin. Code sharing: Developers can write shared business logic in a common C# library and connect the UI with the business logic. They can also call platform APIs such as camera using C# APIs provided by Xamarin for all ios and Android platform APIs. This allows C# and.net developers to build native ios and Android apps using their existing skill set. Platform capabilities: The entire ios and Android platform APIs are 100 percent available as C# wrappers. Integrated development environment (IDE): The Xamarin IDE is available as a standalone on Windows and on a Mac. Xamarin can also be installed in Visual Studio to leverage Visual Studio features in Xamarin app development. Compile-to-native: Developers can use Xamarin to compile the app to native code, ensuring that it looks and runs like a native app built using XCode or Android Studio. 12 Your guide to cross-platform solutions
Part two: App Types at a High Level (cont.) Finally, cross-platform, Apache Cordova Hybrid tools (Visual Studio Tools for Apache Cordova using HTML and JavaScript) enable developers to design and write mobile apps in JavaScript, HTML5 and CSS. The apps typically have a native shell containing a WebView (much like a browser) that can call on the device capabilities. Depending upon the JavaScript libraries and tools used, developers get the same look and feel across the platforms, or can leverage CSS and other techniques to adjust the UX for a particular platform. However, there are some nuances to this approach: User interface: Mobile apps use HTML elements and JavaScript to create the app UI. Code sharing: Typically, the entire app, from the UI to the business logic, is shared across all mobile platforms. Platform capabilities: Apps have access to device capabilities via Cordova plugins, native code that is accessed through a JavaScript API. There s also a healthy open source, Apache Cordova ecosystem, which ensures the wide availability of Cordova plugins. Integrated development environment: Visual Studio or Visual Studio Code provides a development experience for Cordova apps, with various levels of support and productivity enhancements, but there are many other tools vendors and IDEs. 13 Your guide to cross-platform solutions
Part three: Xamarin Versus Cordova Find your best route to a cross-platform app
Part three: A Comparison of Solutions The following table provides a high-level outline of the key differences and considerations between Xamarin and Cordova. These represent extremely different skills and approaches to building a mobile app. XAMARIN CORDOVA (HTML5/JS) UI & controls Xamarin provides native UI controls for each platform. The app UI has exactly the same controls as the native platform tools (Xcode or Android Studio). Xamarin provides UI designers for ios and Android that allow developers to design the UI for each platform using platformspecific controls. The developer writes shared business logic for all platforms to drive the data/actions of the UI controls. Xamarin also introduced Xamarin.Forms, which allows developers to use a declarative language to define a single, shareable UI. This UI is converted by Xamarin into platformspecific UI using native controls. This is used for apps with simpler UI. Cordova apps can use HTML and JavaScript to generate the UI. Typically developers use a UI framework such as ionic or Onsen UI. Apps can be built to have common, shared and similar UI across platforms. If developers are using specialized controls or CSS, they can modify their UI for a given target platform. Developers are therefore free to choose their app pattern and framework, UI controls, etc. Languages and skill set.net, C# HTML5, JavaScript, TypeScript, CSS and other frameworks such as Angular or Ionic App patterns Typically, developers use an MVC or MVVM app pattern like MVMCross. Developers are free to use an app pattern of their choice. 15 Your guide to cross-platform solutions
Part three: A Comparison of Solutions (cont.) XAMARIN CORDOVA (HTML5/JS) Access to core platform APIs Xamarin provides a C# equivalent of all platform APIs provided by ios and Android. These C# APIs are simple wrappers on top of the platform APIs, allowing developers to write business logic and platform-specific code with the same C# language. Xamarin provides a public gallery of libraries with extended functionality for the community, such as libraries for app services. The Cordova community builds specific plugins for different platform-specific functionalities, such as access to the camera. This allows Cordova apps to use platform-specific capabilities as needed. The Cordova community is vibrant and active, leading to wide variety of plugins. Performance Comparable to native Dependent upon the WebView the app runs within and the capabilities of the frameworks being used. Developers may take specific steps to improve performance and experiences removing the tap-delay, for example, or embedding CrossWalk for Android apps. Code reuse Typically, business logic can be shared across platforms. In this case, UI is still defined for each platform. Xamarin.Forms also allows sharing of UI code across platforms. It should be noted, however, that Xamarin.Forms is used for apps with simpler UI design. Yes. Developers typically share both UI and business logic. Cost Paid product. Pricing at Xamarin.com Free 16 Your guide to cross-platform solutions
Xamarin and Cordova are just two of the many cross-platform solutions. Others include React Native, NativeScript, and Azure PowerApps. For more information about these and other solutions, visit the Visual Studio Mobile Platform page.