PhoneGap

An HTML5 app platform that allows you to author native applications with web technologies and get access to APIs and app stores.

Select a PhoneGap API to see it demonstrated.

See assets/www/apis/ for JavaScript implementations of each API.

© 2012 Mobile Developer Solutions

Accelerometer

Captures device motion in the x, y, and z direction.

Toggle to stop/start accelerometer watch.
Get Current for one-time accelerometer reading.

Toggle Get Current
X:
   
Y:
   
Z:
   
Timestamp: 0

Camera

The camera object provides access to the device's default camera application.

Take a Picture using device camera.
Select to get picture from album or library.

Take a Picture Select

Capture

Provides access to the audio, image, and video capture capabilities of the device.

Audio Image Video
Capture Result:

Compass

Obtains the direction that the device is pointing.

Toggle to stop/start compass watch.
Get Current for one-time compass reading.

Compass Heading:
Toggle Get Current

Connection

The connection object gives access to the device's cellular and wifi connection information.

Check Connection
Connection:

Contacts

The contacts object provides access to the device contacts database.

Check Contacts

Device

The device object describes the device's hardware and software.

Important Access device object only after deviceready event.

Device Value
Name  
Platform  
PhoneGap Version  
UUID  
OS Version  
Screen Value
Width  
Height  
Available Width  
Available Height  
Color Depth  

Events

PhoneGap lifecycle events.

Tap device (or virtual device) menu or search buttons to see example callback output.

Other event example callbacks use console.log

File

An API to read, write and navigate file system hierarchies.

Create Write
Status:
Read Remove
Read text:
Data Url:

Geolocation

The geolocation object provides access to the device's GPS sensor.

Toggle to stop/start geolocation watch.
Get Current for one-time geolocation reading.

Toggle Get Current
Location Map

Media

The Media object provides the ability to record and play back audio files on a device.

Play MP3 Song
Play Pause Stop
Current: 0 sec   Total: 0 sec

Live Audio Recording (5 sec)
Record Audio Playback
Status:

Notification

Visual, audible, and tactile device notifications.

Storage

Provides access to the devices storage options.

Based on W3C Web SQL Database Spec and W3C Web Storage API Spec

Create DB SQL Result Set
SQL Result:


Write LocalStorage Read LocalStorage Remove Item
Local Storage: