Converting existing static website to an android app (APK) using phonegap

12,728

"And I have setup the phonegap in my windows 7 PC as well."

I'm assuming your CLI is ready for cordova development. Then it's enough to follow this tutorial/documenation.

Go to your desired directory where you want to build your project. e.g.

d:
cd d:\myworks

Then create a cordova project

cordova create hello com.example.hello HelloWorld

go inside the project directory

cd hello

And platform android

cordova platform add android

There will be a www folder inside yourProject hello->www

Delete all css js html folders inside that directory and put your static pages there.

connect your device to PC and run cordova run android

Share:
12,728
Asanga Dewaguru
Author by

Asanga Dewaguru

Updated on June 04, 2022

Comments

  • Asanga Dewaguru
    Asanga Dewaguru almost 2 years

    I've a static website which purely uses only HTML5 and JS. And I have setup the phonegap in my windows 7 PC as well. My Question is what are the steps that I've to follow in order to create an android APK file out of the existing HTML/JS files. There are lot of tutorials on creating new phonegap project from the scratch. But I couldn't find any help on importing existing static website to phonegap project (please note that https://build.phonegap.com/apps is not an option for me.)

  • Asanga Dewaguru
    Asanga Dewaguru almost 10 years
    Thanks a lot. I've tried this solution it's working fine. And I've a small query. Is it a must to stick to the folder structure inside the www folder. is it ok if I keep all the css js and HTML resources inside my own folder?
  • AtanuCSE
    AtanuCSE almost 10 years
    you can use any structure inside that www folder. You can use your own folders, subfolders etc. BUT you need to keep the index.html file as it is now. just like www->index.html or you will need to change some settings.
  • Asanga Dewaguru
    Asanga Dewaguru almost 10 years
    that's really helpful thanks a lot again. last but not least, where exactly you can find the APK which I can used to copy to the actual device? is it in ..\platforms\android\ant-build ?
  • AtanuCSE
    AtanuCSE almost 10 years