Blog

MOBILE APPS: NATIVE VS CORDOVA OR PHONEGAP

Mobile Apps: How to decide whether to develop a native or hybrid application (using Cordova)?

At some point we have faced the dilemma of deciding how to develop mobile apps: native vs Cordova or PhoneGap. To help you decide how to develop your mobile app, we presenta list of reasons why to make a native app or a hybrid app (the latter case using Cordova or another tool).

It is important to keep in mind the critical factors of the app as well as the budget, as these will define the method to choose.

Why uses Cordova?

1. More developers available

Generally, developers for a particular platform such as Android or iOS are scarce and expensive. Instead, there is more availability of front-end developers or full-stack developers in the market that handle HTML, CSS and JavaScript, which can apply their knowledge to develop an application in Cordova without problems.

2. Convenient for simple applications

With Cordova it is quite easy to create form-based, or proof-of-concept applications.

3. Easy to handle images

The handling of image files is simpler, since it is done with CSS, and it is not required to define the different resolutions that are required in native apps, in which you have to define different files for different screen resolutions.

4. A single code base

By developing an application with Cordova, multiple platforms can be supported with the same code base, which saves maintenance costs.

5. Native features available as plugins

Many of the native functionalities are available as plugins. In this table of platforms supported by Cordova you can see that the most common features such as camera, accelerometer, device storage, etc., have plugins to be used from your Cordova application.

 

Why uses Native?

1.Better client-side data processing

Recommended when there is more client-side processing: Provides better performance, speed, and security than a hybrid application.

2. The interface responds faster to user interaction.

When the application is native, it is easier to make the application feel fast in response to user interaction. With Cordova, if the DOM is not handled properly, the application can feel a bit slow. For example, if we have multiple tabs in an application with Cordova and Ionic, if a tab has many controls, the app can take up to 3 seconds to display the tab selected by the user. The number of controls you have in the tab impacts proportionally the time it takes for the tab to appear. This problem is more common in tablets, which have a large screen where several controls fit at once.

3. The user experience is homogeneous with the rest of the platform’s applications.

Each platform has its own way of doing things In the case of Android, a Floating Action Button or FAB is used to show the most important action to the user and the rest of the actions are placed in the Action Bar. In the case of iOS, the actions to be executed by the user are placed inNavigation Bar or Toolbar.

The design of the icons also varies when you switch platforms. On Android, the icons used within the application follow the Material Design style, so they are simple and flat. On iOS, the icons follow another design where only color is put on the lines that define the icon. You can learn more about icon styles by viewing the Android Material Design icon collection and iOS icon templates.

When you use Cordova to develop your apps, you usually implement a single UI for all platforms. This means that you have to make the decision whether your UI will be neutral or if it will be more attached to the UI guidelines of a particular platform.

4. Does not require extensive testing on multiple devices after making a change.

Does not require extensive testing on multiple devices after making a change. In the case of using Cordova, being the same code base, making a change that works on one platform may mean inserting a bug on another platform.

5. Support for very old versions of Android/iOS

Support for very old iOS/Android versions: Using Cordova for example we will only have support from Android 4 (Ice Cream Sandwich – API 14) and in iOS from version 6.0.

6. Recommended for multithreading applications

Multithreading in Cordova is not 100% supported on all platforms and some problems can be encountered when multithreading a hybrid application; therefore, native applications seem a logical choice if multithreading is an essential part of the application.

7. Ease of handling database migrations.

Migrations are necessary when you have an app with a database in production, in which users already have data stored, but it turns out that we are going to release a new version of the app and for this new version we have to change the database schema. In order to update the app without damaging the users’ data, it is necessary to update the database schema with a migration. The migration will allow to modify the database that the users are already using without them losing the data.

Android and iOS already have certain established practices for handling database migrations, but Cordova does not yet have an established practice. One could develop their own database migration system, as Alin Pandichi did in his blogpost; or opt to use a library like Persistence.js, which has a plugin for database migrations, but as of today – December 14, 2015 – Persistence.js does not yet have support for Cordova in its stable version, there is only support for Cordova in the master branch.

8. Full availability of platform features and support.

There is no risk that a functionality of the platform cannot be used due to the lack of a plugin created by a third party. If the native language is used, there is certainty that all features can be implemented and are supported by Android, iOS, etc.

Conclusions

Developing native applications requires developing a code base for each platform: Android, iOS, Windows, Blackberry, etc. Developing a hybrid application, on the contrary, is to have a single code base for all platforms. At first glance, it would seem that a hybrid application is better if you want to save on development and maintenance costs, but the reality is that each developer must evaluate whether their application will benefit from native development or hybrid development.

References

[1] Quora: Pros and cons of using Apache Cordova phonegap for building your iOS app

[2] Cordova vs native apps

[3] Things to consider when making ios and android apps with cordova or phonegap

[4] Slideshare: How to create one app for all platforms using phonegap

Image from: Android Magazin.