After all Phonegap (Apache Cordova) actually compiles the applications in PURE native code?

Asked

Viewed 1,431 times

7

Does Phonegap (Apache Cordova) actually compile applications in PURE native code or does it act as a layer between a browser and the phone’s S.O. code? Which of the two options below is the most correct?

I’ve heard that it’s just a browser with its application, all this encapsulated (compiled) in a native application that will just open this so-called "mini-browser" with its HTML5 + CSS + Javascript application, it’s true that?

Or Phonegap actually transforms the code (HTML5 + CSS + Javascript) produced on it into the native code of each S.O. (accessing the API without intermediaries)?

  • The native app it generates is basically a browser. The html/css/js code runs in this "browser".

  • As generated some doubts, I edited to try to facilitate the understanding. If you did not give better understanding to your intention, please reverse or reissue.

2 answers

8

Phonegap produces a static application composed of a native webview and code to expose the functionality of each system to a javascript API. Your HTML/CSS/JS code will be packaged without significant changes along with the native Phonegap system and will run like any other web page, but offline and with access to native functions. The engine that will actually run your Javascript depends on each platform.

Session Overview of documentation:

The application itself is implemented as a web page, named index.html by default, that References whatever CSS, Javascript, images, media files, or other Resources are necessary for it to run. The app executes as a Webview Within the Native application wrapper, which you Distribute to app Stores. For the web app to Interact with Various device Features the way Native apps do, it must also Reference a Cordova.js file, which provides API bindings.

Free translation:

The application is implemented as a web page, named index.html by default, which references any CSS, Javascript, image, multimedia file, or any other resource needed for it to work. The app runs as a Webview within the native application encapsulation, which you distribute to app stores. In order for the web application to interact with the various features of the device in the same way that native applications do, it must also reference the file Cordova.js, providing connections to the API.

  • 1

    I did not vote down, because your answer is correct if you delete the first words. What is written, including in your reply is that the your application will not be native. And that’s what was asked, at least that was my interpretation. The fact of having an "interpreter", this yes to be native, is irrelevant.

  • I don’t understand where you’re wrong. The native part would be static in the sense that it does nothing and only works as a background for the application itself, in js/html. "Yes" was in response to "It’s true that[?]".

  • My interpretation of the question was different. I understand that he wants to know if html/css/js will disappear and give way to native machine code or some other intermediate form p/ o S.O. In fact, he asks in two ways, which leaves room for ambiguity. I read your yes as, "Yes, Phonegap actually compiles applications in PURE native code" and applications will still be interpreted html/css/js (or jittados, do not know the technology) by a host that is native.

  • 1

    I edited it to make it clearer.

2

The application will continue to be an application made in HTML + CSS + JS, that after the build, will be encapsulated in an app, but running as if it were a webview, depending on the device/platform that, with Cordova, will provide the resources to access some native functionalities.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.