Pros and cons of Cross-platform Mobile Development

In our extensive experience in software development, we at Magora have often found our clients have doubts about whether choose cross-platform or native mobile apps.

The idea of building one app for all platforms looks very attractive. However, this decision may not have the best effect on usability, appearance, functionality and application downloading speed. Our experts are ready to help you understand the fundamental distinction between these two approaches and help you decide which is best suited to your project based on hard facts collected over years of practice.

What is the key difference: Cross-platform vs Native Development?

Native development is the use of original programming languages ​​and tools of a mobile operating system in programming. For iOS, apps are created in the XCode development environment using ​​the Objective-C, Swift, C, and C ++ languages. To create Android applications, the Android Studio environment and the Java language are often used. Each development environment contains a whole range of utilities for writing code, designing an interface, debugging, profiling (monitoring) and building software. Both the environment and the corresponding set of utilities are created specifically for each mobile operating system and are the most convenient and powerful means of developing mobile apps.

Cross-platform development involves the use of special frameworks to create a program based on the JavaScript family of languages. The whole structure and logic is created with the help of such tools as PhoneGap, Xamarin, Titanium, Cordova, etc. in JavaScript, and then turns into a native trigger element, i.e. is integrated into a basic project for XCode or Android Studio, allowing you to create project assemblies with the same logic under several operating systems at once.

Cross-platform Development

There are two main ways to build a cross-platform mobile app: do it manually by writing C ++ code and wrappers for different operating systems, or use one of the special resources.

The essence of the first approach is that the C ++ code can be run anywhere. In Android, it uses NDK, in Windows Phone Managed C; other platforms have their own ways of processing and running the code. Another thing to note is that this code will be limited in its capabilities. For example, on Android, it will not be able to access the screen or even launch itself. To work around these limitations, you first write a library with basic logic in C ++, then a wrapper in the native language that starts the library and ensures its interaction with the device. This approach is suitable only for a limited range of apps - where there is really a lot of logic on the clients, it makes sense to place it in a separate library.

The essence of the second approach is the use of cross-platform mobile development technologies. Here are a few of the most popular:

  • Unity 3D - a development platform for creating multi-platform 2D and 3D games and interactive content;
  • Xamarin - a framework for cross-platform programming of mobile applications (iOS, Android, Windows Phone) using C #;
  • Ionic - SDK for hybrid mobile app development, a set of CSS and JS components, created on the basis of AngularJS, SASS and Apache Cordova;
  • React Native - framework for assembling native apps from Facebook.

It's not even so much about cross-platform applications as about the "Learn once, write anywhere" principle - that is, the ability to use the same technology to create software on different platforms, providing a high percentage of code re-use.

Another option for writing a cross-platform application is using HTML5 + JavaScript. This is how, as an example, the Atom text editor, Visual Studio Code and Slack are written (even the desktop version is essentially a browser made to look like a regular app).

Benefits of Cross-platform Development

The cross-platform approach has the following positive aspects.

It takes fewer resources to implement an app immediately under several platforms. In this, in fact, is the essence of the cross-platform approach - the same code works on both iOS and Android. Programmers involved in the project need exactly half as much. The designer supplies only one set of graphics. All this reduces the number of working hours and the budget of the project.

Due to the lack of unique interface elements and simpler technologies, you need less time to create simple products.

  • Simplified product update cycle

If you need to add to or fix something in the project, this is done immediately for all platforms to which the product is distributed.

  • Ability to use a mobile site version

Most cross-platform software solutions use the JavaScript language family, so if you already have a mobile site version, a significant share of the code and materials can be utilised in the application without changes.

The embedded logic in the mobile app will work in the same way on all platforms. Quite often this can be a minus due to different operating system architecture (a vivid example is the Back button in the navigation between screens: Android has a hardware Back button for these purposes, iOS has the finger-swipe from the left side of the screen or a button on the left-hand side of the navigation bar. If the button is not provided at all, iOS users will not be able to go back; if provided, but not in this position or with a non-standard appearance, iOS users will be unaccustomed and uncomfortable. If provided as in iOS it will be unusual for Android users, something to written and debugged once the logic contains potentially fewer discrepancies and errors in your work: you don’t have to do double or triple the work to reveal problems on each platform.

It's Not That Simple

The advantages of cross-platform mobile programming are that you can write an application or any of its components once, using C ++, and run them on different platforms and devices. Logically this will require less expenditure. So the plan seems to be - write and enjoy! However, this approach has a number of drawbacks.

All of these stem from the same issue: all platforms are different.

Let's consider the main inconveniences we’ll have to face having embarked on the path of cross-platform development.

Each mobile platform has its own standards: standard gestures and controls, arrangement of elements, appearance of icons etc. For example, it’ll take one glance at the screen to understand whether it’s iOS in front of you or Android. Having developed an app that looks the same on all platforms, you’ll find that users won’t be able to use common management methods or see the usual design, meaning they’ll find it less convenient than the native version.

This often affects games ported to a PC with PlayStation: many of them do not support a mouse and do not allow you to configure keyboard shortcuts that are convenient for the player, which makes them less convenient than games designed specifically for the PC. And if such applications as Mortal Combat or Final Fantasy can "leave" at the expense of nostalgia, then developers of new games should consider all the details in advance and not deprive users of their familiar controls.

Another point is that all the platforms differ in appearance: fonts, size and shape of the buttons, the appearance of the calendar, the checkboxes, radio buttons ... Even if you want the app to look just like the native one, you'll have to develop style sheets on each platform, , and the cost of development will grow.

In addition to the inconvenience to the user, cross-platform mobile development is fraught with a number of problems for the developer. The fact is that actions that look the same for the user on different platforms can be implemented in completely different ways. Consider the examples.

This familiar action, like drag and drop, is fundamentally different for the Mac and for other operating systems. If on Windows or Linux this action is processed by the application itself, then the operating system directly enters the game on the Mac, which means that the developer will need to create a separate "file open" event in order for this action to work correctly on the Mac. So, it is necessary to reconcile or with the growth of labor for development, or with the fact that the usual drag and drop on this OS simply will not work.

Another example is the opening of a specific document. On all platforms, this action launches a program and tells it which document to open, as a parameter, on the Mac, a special "open file" event is used. Again, we are faced with increasing labor costs, and hence, the cost of development.

Practically in any dispute, devoted to the advantages and disadvantages of cross-platform mobile software, you will see an argument that cross-platform apps are much slower than their native counterparts. This is both true and false. As an example, the code written in C ++ and launched on Android using NDK will work faster than a native program. However, if you use, for example, PhoneGap, the app starts working on the principle of "The house that Jack built": PhoneGap calls JS, which accesses Java, which runs on a Java machine that operates on a real phone. For sure, this negatively influence the performance.

And What is the Best Suit for a Project?

Someone may think that our goal is to convince everyone to abandon the development of cross-platform mobile applications. Not at all: we call to evaluate which approach will be the best for you, and not to chase the apparent cheapness of such solutions. There is no single recipe for all cases, each project needs to be evaluated separately.

Most applications, of course, lie somewhere between these extremes, so a thorough analysis will be required to choose one of the approaches. Try to estimate:

  • What share of your users will scare away, for example, an unusual kind of buttons or the non-use of the top menu on OS X?
  • Are there many features that will require significant improvements for one or more mobile platforms?

Only A / B testing can provide accurate results, but even after considering it, you should make a lot to select the best approach to development.

We Are Always Ready to Help

Here at Magora, we have built a lot of software products for companies large and small. Our mobile developers has experience and expertise in a variety of techs and languages. Contact our Customer Department and share your ideas. Together we will find the best way to drive your project to success.

Still have questions? We are ready to help