I want to write an HTML5 app to activate the user's camera to read a barcode.
I don't know what the difference is between PhoneGap and Cordova so I'm really confused. I'm probably installing way too much software on my PC, but I'm just trying to follow directions and hopefully at some point will be able to start writing some JavaScript.
I installed npm on my Windows 8 machine. When I type "phonegap run android" is says
[phonegap] detecting Android SDK environment...
[phonegap] using the local environment
[phonegap] adding the Android platform...
[phonegap] missing library cordova/android/3.3.0
[phonegap] downloading https://git-wip-us.apache.org/repos/asf?p=cordova-android
.git;a=snapshot;h=3.3.0;sf=tgz...
[error] An error occured during creation of android sub-project.
C:\Users\Phillip\.cordova\lib\android\cordova\3.3.0\bin\node_modules\q\q.js:126
throw e;
^
Error: ERROR : executing command 'ant', make sure you have ant installed and add
ed to your path.
at C:\Users\Phillip\.cordova\lib\android\cordova\3.3.0\bin\lib\check_reqs.js
:47:27
at ChildProcess.exithandler (child_process.js:641:7)
at ChildProcess.EventEmitter.emit (events.js:98:17)
at maybeClose (child_process.js:743:16)
at Socket.<anonymous> (child_process.js:956:11)
at Socket.EventEmitter.emit (events.js:95:17)
at Pipe.close (net.js:466:12)
I then downloaded ant and extracted it to c:\apache-ant. I then added user variables ANT_HOME with a value of c:\apache-ant. I also added ;C:\apache-ant\bin to the system variable "path".
When I drop to the cmd line, and type "cordova" is says that cordova is not recognized.
Edit 1: typing "phonegap run android" yields:
[error] project directory could not be found
Edit 2:
Maybe I should just download cordova.js from their download page. I'd be happy to have it work for only the iPhone at first.
I would recommend using PhoneGap Build. PhoneGap Build can be found at:
If you use that then you can scan the app directly with your android device, with a bar code reader. The app will automatically download to your device and you can run the app there.
You can also use another program called BlueStackes. Link:
BlueStacks is an emulator.