Creating the web app from an existing app

If you’ve already created a conventional Android PhoneGap app, you can quickly build a website from it.  Here’s how:

Step1: Your Android app project has a web directory structure, typically located in the directory “assets/www/”.  Copy it to the web server’s root folder or a web-accessible subfolder of your choosing.

Step2: Place a copy of cordova.dolphin.js on the web server, perhaps in the same folder.  This file contains the Dolphin JavaScript extensions for PhoneGap.  It is available here.

Step3: In the index.html, replace the original “cordova-1.x.x” with “cordova.dolphin.js”, specifying the correct path to the file.

<script type="text/javascript" charset="utf-8" src="cordova.dolphin.js"></script>

If you would like to try this on a sample app, consider using the PhoneGap Android demo app on the PhoneGap website.