Converting existing static website to an android app (APK) using phonegap
"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
Asanga Dewaguru
Updated on June 04, 2022Comments
-
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 almost 10 yearsThanks 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 almost 10 yearsyou 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 likewww->index.html
or you will need to change some settings. -
Asanga Dewaguru almost 10 yearsthat'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 almost 10 yearscheck this out stackoverflow.com/questions/20402818/…