Xamarin vs. PhoneGap: Which Cross-Platform Mobile App Software is Right for You?

Image for Xamarin vs. PhoneGap: Which Cross-Platform Mobile App Software is Right for You?

In the world of mobile development, cross-platform software has become one of the best ways to create flexible, native-feeling apps efficiently, with reusable, shareable code bases that can be transformed to run natively on a variety of platforms. But accomplishing that native user experience without native app code comes with a few compromises: app file size, performance, overhead, and in some cases, cost. Which platform you choose for your cross-platform app will largely depend on your goals for your app.

Not all cross-platform mobile app solutions are created equal, so it’s important to get an idea of the strengths of each, pros and cons, weighing how much integration you’ll need, how much your app needs to scale up, your budget, timing, what other components are in your technology stack. Whether you’re head of a mobile development team or a solo developer working on an app, you’ll want to choose the technology that best meets your requirements and gives you the tools you need.

Join Upwork

WHAT ARE CROSS-PLATFORM APPS?

First, a quick refresher: What are cross-platform apps, and why might you be creating one over a native or hybrid app? Creating native applications for each different operating system—iOS, Android, and Windows—requires a lot of effort: different source code versions, developers who know each platform, then the time to build, maintain, and update each version.

Cross-platform apps have an advantage: they allow a developer to create one source code for an app, which the platform then converts into code for the native environment. The immediate benefits? There’s a much more native app-like performance than a hybrid app. Also, developers can reuse code that’s already been written, letting the platform handle the compiling. This makes it faster and more cost-effective. Read more about the benefits and compromises of cross-platform apps.

Now, let’s take a look at two top mobile app technologies, Xamarin and Phonegap, with differences between the two and a few pros and cons to help you decide which is best for you.

XAMARIN

Xamarin is a cross-platform software that generates native apps with platform-specific user interfaces (UI)s. Xamarin compiles the app’s code base and UI code by accessing native APIs for each platform, whether that’s Android, iOS, or Windows. What you get in a totally native experience you do get in file size—Xamarin does have some overhead. But the native experience and launch speed users get is nearly unmatched.

Xamarin Basics

  • Programming language: C#, .NET framework
  • Platforms: iOS, Android, Windows, Blackberry
  • Device API access: Can fully access native capabilities
  • Free or paid: Open-source.
  • User Interface: Native
  • Compatible with: MDM software
  • IDE: Xamarin Studio (free), but you can also use Visual Studio for much of the development.
  • Xamarin.Forms library: This is how the native UIs are created and rendered using native controls of each platform.
  • Xamarin.Android library: Support Google Glass devices, Android Wear, and Firephone
  • Design patterns supported: MVC, MVVM
  • Companies using Xamarin: GitHub, Foursquare, Microsoft

More to consider about Xamarin

A shared code base requires less time and resources. When you’re working with the one, shared C# code base, that code base can be used among the three platforms, leaving the majority of the effort to creating the platform-specific UIs. Think of it like 70% Xamarin code and about 30% native code—and the Xamarin code is reusable with the .Forms library. Note that it’s helpful to have an experienced Xamarin expert who knows their way around the platform to keep code neat and organized.

The user gets a 100% native performance. With Xamarin.Forms, the UI is rendered completely with native controls, so what the user ends up with is a completely native UI experience. The only drawback is a larger app file size—there’s a bit more overhead (and its own runtime) required to accomplish that totally native UI, so keep that in mind for devices that need to capitalize on resources.

Xamarin apps are easy to update. One of its core benefits is the ability to make updates, changes, and improvements to the app over the lifespan of an app relatively easily.

TestCloud. Xamarin TestCloud allows you to test apps automatically, and build, test and monitor your app in the cloud after development.

If you know C#, it’s not hard to learn. You’ll need to know languages for the native environments—whether that’s Java and Kotlin or Objective-C and Swift.

Overall: The Xamarin app may be superior to the HTML5-based experience you’ll get with PhoneGap.

Adobe PhoneGap

The PhoneGap framework (from Apache Cordova) also allows you to work with one code base, but with a different set of technologies. PhoneGap is an open source, cross-platform tool that builds apps with HTML, CSS, JavaScript, and Web APIs, along with frameworks like jQuery Mobile, Backbone.js, or Ionic. A PhoneGap application is essentially a collection of HTML pages wrapped in a native app shell, which are then pushed out to native platforms via native APIs.

With PhoneGap, developers create files in HTML, CSS and JavaScript—much like they would when creating a website. These files are stored in a local directory or in the cloud, then when they’re run on a device, they access device features through plugins. This makes PhoneGap apps lighter-weight and highly reusable, but they have less of a native feel, and the quality of the UI is going to depend more on the Web View engine of the operating system rendering it—e.g., iOS UIWebView class, or Android’s android.webkit.WebView.

PhoneGap Basics

  • Programming languages: HTML5, CSS, JavaScript
  • Platforms: iOS, Android, Windows Phone, Blackberry
  • Device API access: Limited. HTML5 geolocation, camera, and local database access, plus device API access (such as camera and geolocation) in the PhoneGap Developer App. Does have Web Standard support.
  • Free or paid: Open source. Has a free plan or a paid plan that offers increased data and plugin access.
  • User Interface: Web UI, and more general—not a native look and feel. Native features can be added, but you’ll need to have resources and knowledge of Java/Swift.
  • Augmented reality: Wikitude’s augmented reality Cordova plugin allows developers to build apps that can detect images or locations and project 2D images or 3D models.
  • PhoneGap Enterprise: Enterprise-level platform for building more robust apps, with integrated marketing support.
  • Companies using PhoneGap: Sony, Mozilla, Intel, IBM, SworkIt, TripCase, and Untappd.

More to consider about PhoneGap:

Access to a library of Cordova plugins. Plugins are bits of add-on code that allow you to do more with your app by providing a JavaScript interface to native components. Plugins allow an app to use native device capabilities. There are plugins contributed by the community for everything from file transfer and geolocation to cameras and push notifications.

The PhoneGap Developer app. This is a paired desktop and mobile app setup that allows developers to work locally on apps with built-in access to device APIs. PhoneGap Desktop 4.0 supports PhoneGap template and lets you build apps with features like push notifications without requiring the command line.

Extend your app with templates and third-party tools. HTML5 templates for PhoneGap provide you with shells for your UI, with features like buttons, menus, transitions, text boxes, and more. In addition, tools from providers like Paypal, Amazon and Magento give you access to things like payment, drag-and-drop design, authentication, and theme builders.

Support for Creative SDK plugins. This allows developers to add native components to apps without having to write a line of Objective-C, Java, or any other native code.

Very low barrier to entry. Most developers have a grasp of HTML, CSS and JavaScript, so it’s relatively easy to get started with PhoneGap as it uses these basic web technologies.

Build and compile in the cloud. PhoneGap Build is a cloud-based app building platform that compiles HTML, CSS and JavaScript to native code without needing to install SDKs for each platform.

Which cross-platform software is best for your app?

Consult with a freelance mobile developer about your must-haves for your app to get a better idea of which platform is best-suited for your needs. And remember, each option is also better suited to a developer’s skills—C# developers will be better able to find their way around Xamarin, while developers with front-end skills like JavaScript and HTML5 will be able to easily pick up PhoneGap.

Post a job on Upwork. It's free!

Carey Wodehouse

by - Freelance Content Marketer and Writer

Carey Wodehouse is a freelance content marketer and writer based in Richmond, VA who’s worked for clients ranging from online retailers and global market research… more