Home » Android » cordova – Android: PhoneGap vs Webview

cordova – Android: PhoneGap vs Webview

Posted by: admin April 23, 2020 Leave a comment

Questions:

I have been researching PhoneGap and I’m now at an impasse and need some advice. I know that PhoneGap essentially ‘converts’ html5,css,JS sites to ‘apps’ for distribution, which leads me to my question:

Why wouldn’t one simply utilize a webview within an activity to do the same thing and keep the app native?

How to&Answers:

The advantage of PhoneGap is that it provides APIs that enable your HTML/javascript to interact with the phone (e.g. camera, accelerometer, media etc.)

These APIs are standard across multiple devices (iOS, Android, WinPhone, Blackberry etc.). So you can write one set of HTML/javascript and deploy to multiple platforms.

If you just created a WebView you would not have the PhoneGap APIs and you would need to build containers on each platform you were interested in.

Answer:

Good question I have searched me too, because we went in Phonegap solution and I think it is a wrong way for us.

The long story:
That is very true if you write once a UI with web developer skills than not needed to know native language and it compile, and ready for testing.
Web developers are more so higher the demand => developer price even cheaper.

When the client want a Milestone 1 for his great idea it will ask a few company, freelancers about development price and time. If is a very basic application version with Phonegap you will have the less development cost( off if your web dev skills are the same laver as platform dev skills) with webView at second place and last one the native.

The client is satisfied with app result buit with Phonegap and want to get more investors so it will make a presentation, where they are asking more features.

At Milestone 2 you will add a few features. Some are easy command line install and you get it, some aren’t. Maybe you will be unlucky as you want a combination of 2 existing plugin with a few extras. The conclusion will be: you have to develop a plugin. At this point is already a very big sign of interrogation which is cheaper: the Phonegap + Phonegap plugin or a WebView. If you need 5 existing plugin and your has a little modification, than still Phonegap. But if you need only 1 plugin, only yours, than the web view is the proper way. There are also cases which makes the Phonegap stucture useless. Also there is a problem with version control system under Phonegap if you develop web files, and native code too: some are regenerating at each build time some not. Still is expensiver the native platform. Now the required features are developed. The client will make a demo for investors, where will be visible execution speed with this new features. Or here they will require optimisation, runtime speed-up or after publish to market they will see some are running with low end phones and not the ultimate, which ws used at demos and they will decide to go to Milestone 3 : speed up.

At optimisation, speed up (Milestone 3) you will decide as you need native GUI. After all GUI developed with web now you will need to throw out at fence and implement the side, maybe some parts need even NDK to speed up. No way to be good here with Phonegap. But you have hired web developers, or contracted that company. Now go back to that company , developers which can make native code. They will not start from 0, so they need to analyse the code, refactor and your development price will go up at least with 50% as you would start it from 0 with native.

Answer:

Good Question, you still could use webview for that but you won’t be able to access native functions like ringtone, camera, and all that, however, the app done that way will be regarded as a native app.