Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Add cordova to already created html\css\js project

Tags:

cordova

I have a Project in HTML/CSS/JS etc, I want to make its APK. My current project folder structure contains these things:

projectName

css

js

lib

templates

views

app.js

index.html

So how can I add Cordova to my project which is ALREADY CREATED?

like image 451
Muhammad Faizan Khan Avatar asked Jan 14 '15 07:01

Muhammad Faizan Khan


2 Answers

  • Create a new cordova project.

  • Add your files into the /www folder of the project.

  • Reference the "cordova.js" file in your index.html page.

PS: Please dont alter or change "cordova.js", "cordova_plugins.js" and "plugins" folder when adding files to your /www folder. (Cordova 3.0 +)

As QuickFix said, "you don't add cordova to a html5 project but you add your html5 files to a cordova project."

Hope it helps.

like image 84
locknies Avatar answered Nov 12 '22 23:11

locknies


If you have created this folders and files manually, I suggest you to create another new project with Cordova command line, then move your files to the newly created project.

cordova create hello com.example.hello HelloWorld

like image 34
Reza Avatar answered Nov 13 '22 01:11

Reza