We’ve serialized the book “Building Cross-Platform Apps: jQuery Mobile Apps in action”, which is very popular with Mobile developers. From now on, I will serialize its twin sister book, PhoneGap Mobile Application Practical Book. I hope you who used to be little white have become big white.

3.6 What does the API in PhoneGap do

This chapter focuses on what you need to do before you start developing PhoneGap, so isn't it time to cover a few things about PhoneGap? PhoneGap is simply a page written in HTML that is displayed and then retrieving a few sets of data using a specific JavaScript.

While developing with PhoneGap is primarily based on your knowledge of HTML, the most important thing for a PhoneGap developer is how to use the PhoneGap API. PhoneGap provides developers with API interfaces such as battery status, camera, contacts, file system, audio, etc. This section describes what they can do and what they can do.

The Accelerometer is an Accelerometer.

The Accelerometer, commonly known as Accelerometer, is used to capture the phone’s acceleration in all directions. For example, you can use a gravity acceleration of about 10 to get the current orientation of the phone, and you can use it in some games along with some algorithms to do motion-sensing (for example, to simulate the user’s steering wheel).

2. Camera

A Camera, as it literally means, can be used to capture information captured by the Camera, but it is generally of little use.

3. Capture (Capture)

Capture is similar to a tape recorder or video recorder. It can be used to record audio and video or Capture images and upload them to the Internet. It can also be used to Capture multimedia information from the Internet. Capture is used in some social applications, such as Renren, where it is easy to upload images.

4.. Compass (Compass)

If the acceleration sensor is used for induction of gravity direction so as to know the ground, you can obtain the direction of the north and south, east and west in the compass, and may use it and acceleration sensors, the geographical position sensor to cooperate to achieve some amazing features, such as the user is currently shooting the photos of the user’s location.

It sounds fanciful, but it’s not impossible. A geolocation sensor tells you that you’re at the beach. The compass also proves that the user is facing the sea; You can figure out what the user has taken without even analyzing the photos.

5. Connetion

Connetion is only able to judge the network state of the user, which I feel is a bit lame.

6. Contts

Contts is a very useful set of APIs for adding, deleting, modifying and checking contacts on the device.

7. Device (access to Device information)

Device can get the version number of the Device, operating system, and other information.

8. System Events

Events are callbacks that respond to system time, such as notification when a user’s battery is low, and can also respond to functions such as volume keys or search keys.

9. File Management System

You can use File to manage files on your phone, but due to PhoneGap’s execution efficiency, you are not advised to try to develop a File manager or even a simple eBook reader with it. It is still OK to use File in an application to perform some simple operations on files (such as saving some messages or notes in TXT).

10. Geolocation (Location Sensor)

Geolocation is what users call GPS, one of the more common features of social software, and is usually used in conjunction with other sensors.

11. Media

Media is used for recording and playing audio files, which is not as practical as collection tools, so it is also more difficult to use.

12. Notification

Notification can invoke the device’s vibration and buzzer functions, which are typically used to provide feedback to the user’s actions, such as a series of vibrations in a game when the user crashes a car.

13. Storage (Local Storage)

Storage is a very practical set of API, you can use a simple database function locally, in the actual development can also cache some news or chat records and other information.

PhoneGap is becoming more and more accessible, with a lower barrier to entry, and the ability to write less code to generate mobile-friendly interfaces.Building a cross-platform APP: PhoneGap mobile APP in actionThe book takes a case-driven approach to APP development under PhoneGap, provides more than 20 hands-on examples of mobile development, and ends with three mini-projects to review and reinforce what you’ve learned.

If you are interested in jquery Mobile portal is still so, welcome to view the past blog: http://segmentfault.com/blog/shanliangdefenhongtaotao/1190000000610391