phonegap-pluginsphonegap-buildphonegapphonegap-cliphonegap-desktop-app

cant convert existing website to phonegap using url


i have a responsive mobile view website. i need to convert the website into phonegap application with url - just to load the site into the app.

I done many researches on this topic and couldnt find any good answer.

I tried to load the URL throught cordova.js and from config.xml

Is there any way to load the website into phonegap without download the entire files? this site is really big and have connection to users and database.


Solution

  • This isn't how Phonegap is intended to used. That said, if you really want to do this you would use the content element in your config.xml:

    <content src="http://somesite.com/somepage.html" />
    

    and also whitelist it:

    <plugin name="cordova-plugin-whitelist" />
    
    <allow-navigation href="http://somesite.com/*" />
    

    As mentioned this isn't a good use of Phonegap. If you're just going to open a url of the internet, the user may as well open your site in their mobile browser.

    Package your web assets locally into the app and give your users a good experience.