Get ready to access the device's camera, show the user the captured picture, and allow the user to erase the selection (in iOS only). Refer to the following steps:
Open the command-line tool and create a new PhoneGap project named
AccessCamera
.$ cordova create ~/the/path/to/your/source/camera com.gnstudio.pg.AccessCamera AccessCamera
Add the Camera API plugin using the command line.
$ cordova plugins add https: //git-wip-us.apache.org/repos/asf/cordova-plugin-camera.git
Using the command-line tool, add the Android and the iOS platforms to the project.
$ cordova platforms add android $ cordova platforms add ios
Go to the
www
folder, open theindex.html
file, and add abutton
tag with the id#getPicture
, two input tags with attribute type equal to checkbox, and animg
tag with theid
value#shot
inside the main div of the app below the#deviceready
tag; the id values of the two input tags matches exactly to the propertiessaveToPhotoAlbum
andallowEdit...