Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cordova vs Native apps with WebView

The goal is to use an existing web app and create an Android and iOS versions of it with some functionality added (Push Notifications and Location).

Being an Android/iOS developer, does it make sense to use Cordova with its native plugins for such kind of development or it would be wise to end up with 2 codebases (for Android and iOS) that would load the web app in a WebView? Need to mention that all the content must be loaded remotely (no html/css/js files can be stored in the app).

There would be some heavy security requirements on the application and I am afraid of 2 things:

  1. It might be more difficult to implement security using Cordova plugins that using a native app.
  2. It might be more difficult to make one single html/css/js app behave the same on both platforms.
  3. There is no need to use Cordova if I am a native developer and could make things faster with native apps.

If there is someone who could give some opinion or share experience on this, would be very helpful. Thanks in advance!

like image 889
Robert K. Avatar asked Jan 18 '17 15:01

Robert K.


People also ask

Does Cordova use WebView?

Cordova applications are ordinarily implemented as a browser-based WebView within the native mobile platform.

Does Cordova use Android WebView?

I figured out that Cordova is not using the Chrome App as browser. Instead it is using the browser integrated in the "Android System WebView" app, which is updatable in Google Play Store.

Is react Native better than Cordova?

React Native is all about building a true mobile app, while Cordova instead implements web technologies in a mobile solution. Unlike Cordova, React Native development offers much more automation and optimization for a successful product launch.


2 Answers

Depends on complexity of web apps. Got some experience with angularJS heavy apps and I can tell that cordova is pretty slow. Massive SPA's have performance problems, mainly when it comes to listing many elements and/or rendering view based on big .json data.

When you're not working on some big web app - cordova will be perfect for your requirements. It's easy to maintain one codebase and there are no problems in uniforming your app to behave and look the same on many platforms.

Security can be a problem sometimes, but in most cases you can write or use existing plugin that helps for example storing secure data (like passwords) or performing https calls.

As you are native developer, it will be good to try cordova out and see how much time it will consume to develop something. From my experience (I'm not very fluent in mobile app coding) working with cordova is pretty fast.

If you have any questions, go on I will try to help! (sorry for bad english)

like image 43
palucdev Avatar answered Oct 12 '22 18:10

palucdev


At first, there is no harm in spending a little time trying out Cordova.

The Cordova command line tool is easy. The documentation discusses about differences between Android and iOS. I found it a good read. You can learn something if you are not expert in both Android and iOS.

There are a lot of cross-platform plugins for Cordova. If there happens to be a few plugins that you need, they can save time and effort. (Simply cordova plugin add it. Using plugin is simple.)

Cordova performs tweaking for you to make WebView easier to use. (But some people might consider the default Cordova setup unsuitable.)

It seems you will write some Java, C/C++, or Objective-C regardless of whether Cordova is used. There are 2 ways to use Cordova in your app: Write your native code as a Cordova plugin so you can call the plugin from Cordova; Or embed Cordova in your native app. Cordova forces you to organize your app in its ways, so you might consider it inconvenient.

(There is the Web Crypto API, which can be called with pure javascript, but you need to consider if your devices support it.)

If you want to squeeze out every bit of performance, you may want to write your app with WebView eventually without Cordova.

After using Cordova for some time, even if you decide to stop using it later, and rewrite the logic for your own cross-platform codebase, you may still learn useful things by reading Cordova's source code.

like image 98
cshu Avatar answered Oct 12 '22 17:10

cshu