From: http://jinzhe.net/post/8.html
What is PhoneGap? PhoneGap is a framework for using HTML5 to develop apps. It can be used for Android, IOS, WP, BlackBerry, Firefox and other mobile operating systems. Use HTML5 to write interactive interfaces. The advantage is that writing once can be compiled onto a variety of mobile platforms, greatly saving the development cycle for the company. But it also has shortcomings, such as the performance of the original good, can only do some simple app, such as the company's kind, or website client. If you play the game, forget it.
Install the PHONEGAP environment under Mac to install many kinds of third-party software. Git,xocde,nodejs and so on.
1. Installing git:http://www.git-scm.com/
2. Install nodejs:http://nodejs.org/(if you have an older version you need to manually install NPM, but the latest version comes with it)
3. Enter the terminal command line using NPM to install Cordova as follows:
$ sudo npm install -g cordova
4. Go to the project directory you want to create, and then create the PHONEGAP project.
$ cordova create hello com.example.hello HelloWorld
After entering this command, the Cordova program will help you create the Hello folder, which is the PHONEGAP environment.
5. Create the Xcode project file. To compile the app is definitely to use Xcode, do not install to go to the App store download it.
$ cd hello$ cordova platform add ios
Then you use the Finder to go to the subdirectory and you will see the iOS folder in platforms, then you can run the project compilation.
6. The environment is there, but you have to do the project also need to call a lot of system things, such as camera, system information, file operation, etc., or third-party development of plug-ins. Crossing Web Documentation:
Basic device information (device API): (Equipment information plugin)
$ cordova plugin add org.apache.cordova.device
Network Connection and Battery Events: (Web Connection plugin)
$ cordova plugin add org.apache.cordova.network-information$ cordova plugin add org.apache.cordova.battery-status
Accelerometer, Compass, and geolocation: (gyroscope)
$ cordova plugin add org.apache.cordova.device-motion$ cordova plugin add org.apache.cordova.device-orientation$ cordova plugin add org.apache.cordova.geolocation
Camera, Media Playback and Capture: (Camera photo recording, etc.)
$ cordova plugin add org.apache.cordova.camera$ cordova plugin add org.apache.cordova.media-capture$ cordova plugin add org.apache.cordova.media
Access files on device or network (file API):
$ cordova plugin add org.apache.cordova.file$ cordova plugin add org.apache.cordova.file-transfer
Notification via dialog box or vibration: (reminder)
$ cordova plugin add org.apache.cordova.dialogs$ cordova plugin add org.apache.cordova.vibration
Contacts: (Contact person)
$ cordova plugin add org.apache.cordova.contacts
Globalization:
$ cordova plugin add org.apache.cordova.globalization
SplashScreen:
$ cordova plugin add org.apache.cordova.splashscreen
Open new browser windows (Inappbrowser):
$ cordova plugin add org.apache.cordova.inappbrowser
Debug Console:
$ cordova plugin add org.apache.cordova.console
Install PHONEGAP development environment under turn-MAC