Neeraj
Neeraj

Reputation: 1816

Convert Cordova Mobile App to Webapp

We developed an mobile app using cordova for iOS and Android platform. Now is it possible to reuse the existing app and launch it for web as well? If yes can someone please guide how can this be done? Any links, reference.

Upvotes: 1

Views: 1373

Answers (2)

Rinkesh
Rinkesh

Reputation: 3316

The hybrid app is the concept of developing a web application to run on the native platform, so surely we can run Cordova based application on browser.

you need to take care of all Cordova plugin dependency like (Network, Device etc), which is required for developing the hybrid app.

usually, the main source code is available on www folder in Cordova project, we need to put that code in the web container like Tomcat, and you are ready to go. if you are using Apache then provide access there as well.

Make sure your API Service is available on the same host, otherwise, you will face cross origin error.

Upvotes: 2

Tushar Tyagi
Tushar Tyagi

Reputation: 327

Because cordova uses web technologies like HTML, JS and CSS to creative native like apps so Yes, It is possible to just copy paste the contents of your whole www folder and use it on web.

However you will not be able to use plugins at all because a plugin calls native API through use of javascript. And in case of web there will be no native device API.

To use your cordova app on the web just open your project folder and copy whole www folder somewhere. (I recommend to copy it in a local webserver's web directory) , Or you can directly upload contents of www folder on your web host using FTP.

Upvotes: 1

Related Questions