Alex Rivera | Logout

phoneGap startup - do we need all those files?

Asked 2012-10-20T08:21:13.573
20

Alright, I am just getting started with phoneGap for iOS and I am noticing in the www directory that there are plenty of files, such as

spec/helper.js
spec/index.js
jasmine
cordova.js
etc.

Are all those things really needed in order to have it all working? Also, I noticed in "index.js" that, at the beginning of the file, it is creating an app object:

var app = { ... };

and puts all the code inside it;

Is this also necessary in order to bind the events? Like deviceready or others?

Thanks in advance.

Edit
Report

2 Answers

25

The cordova js the only js file needed. This is autogenerated when you ran the phonegap create script.

index.js contains sample code on how to bind to the deviceready event. It can serve as a start for your js code.

The spec folder and spec.html are for javascript testing using Jasmine, a BDD testing framework for Javascript.

answered 2013-01-15T23:55:00.797
4

No, you don't need all these files.
Actually, the only file you need is cordova.js.

answered 2012-10-20T15:57:44.187

Your Answer