incubator-callback-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mwbro...@apache.org
Subject [5/10] Version 1.4.0
Date Mon, 30 Jan 2012 22:41:23 GMT
http://git-wip-us.apache.org/repos/asf/incubator-cordova-docs/blob/69a280f2/docs/en/1.4.0/phonegap/media/media.stop.md
----------------------------------------------------------------------
diff --git a/docs/en/1.4.0/phonegap/media/media.stop.md b/docs/en/1.4.0/phonegap/media/media.stop.md
new file mode 100644
index 0000000..f708bf7
--- /dev/null
+++ b/docs/en/1.4.0/phonegap/media/media.stop.md
@@ -0,0 +1,149 @@
+media.stop
+==========
+
+Stops playing an audio file.
+
+    media.stop();
+
+
+Description
+-----------
+
+Function `media.stop` is a synchronous function that stops playing an audio file.
+
+Supported Platforms
+-------------------
+
+- Android
+- iOS
+- Windows Phone 7 ( Mango )
+    
+Quick Example
+-------------
+
+    // Play audio
+    //
+    function playAudio(url) {
+        // Play the audio file at url
+        var my_media = new Media(url,
+            // success callback
+            function() {
+                console.log("playAudio():Audio Success");
+            },
+            // error callback
+            function(err) {
+                console.log("playAudio():Audio Error: "+err);
+        });
+
+        // Play audio
+        my_media.play();
+
+        // Pause after 10 seconds
+        setTimeout(function() {
+            my_media.stop();
+        }, 10000);        
+    }
+
+Full Example
+------------
+
+        <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
+                              "http://www.w3.org/TR/html4/strict.dtd">
+        <html>
+          <head>
+            <title>Media Example</title>
+        
+            <script type="text/javascript" charset="utf-8" src="phonegap.js"></script>
+            <script type="text/javascript" charset="utf-8">
+        
+            // Wait for PhoneGap to load
+            //
+            document.addEventListener("deviceready", onDeviceReady, false);
+        
+            // PhoneGap is ready
+            //
+            function onDeviceReady() {
+                playAudio("http://audio.ibeat.org/content/p1rj1s/p1rj1s_-_rockGuitar.mp3");
+            }
+        
+            // Audio player
+            //
+            var my_media = null;
+            var mediaTimer = null;
+        
+            // Play audio
+            //
+            function playAudio(src) {
+                // Create Media object from src
+                my_media = new Media(src, onSuccess, onError);
+        
+                // Play audio
+                my_media.play();
+        
+                // Update my_media position every second
+                if (mediaTimer == null) {
+                    mediaTimer = setInterval(function() {
+                        // get my_media position
+                        my_media.getCurrentPosition(
+                            // success callback
+                            function(position) {
+                                if (position > -1) {
+                                    setAudioPosition((position) + " sec");
+                                }
+                            },
+                            // error callback
+                            function(e) {
+                                console.log("Error getting pos=" + e);
+                                setAudioPosition("Error: " + e);
+                            }
+                        );
+                    }, 1000);
+                }
+            }
+        
+            // Pause audio
+            // 
+            function pauseAudio() {
+                if (my_media) {
+                    my_media.pause();
+                }
+            }
+        
+            // Stop audio
+            // 
+            function stopAudio() {
+                if (my_media) {
+                    my_media.stop();
+                }
+                clearInterval(mediaTimer);
+                mediaTimer = null;
+            }
+        
+            // onSuccess Callback
+            //
+            function onSuccess() {
+                console.log("playAudio():Audio Success");
+            }
+        
+            // onError Callback 
+            //
+            function onError(error) {
+                alert('code: '    + error.code    + '\n' + 
+                      'message: ' + error.message + '\n');
+            }
+        
+            // Set audio position
+            // 
+            function setAudioPosition(position) {
+                document.getElementById('audio_position').innerHTML = position;
+            }
+        
+            </script>
+          </head>
+          <body>
+            <a href="#" class="btn large" onclick="playAudio('http://audio.ibeat.org/content/p1rj1s/p1rj1s_-_rockGuitar.mp3');">Play
Audio</a>
+            <a href="#" class="btn large" onclick="pauseAudio();">Pause Playing Audio</a>
+            <a href="#" class="btn large" onclick="stopAudio();">Stop Playing Audio</a>
+            <p id="audio_position"></p>
+          </body>
+        </html>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-cordova-docs/blob/69a280f2/docs/en/1.4.0/phonegap/media/media.stopRecord.md
----------------------------------------------------------------------
diff --git a/docs/en/1.4.0/phonegap/media/media.stopRecord.md b/docs/en/1.4.0/phonegap/media/media.stopRecord.md
new file mode 100644
index 0000000..8ccf9e0
--- /dev/null
+++ b/docs/en/1.4.0/phonegap/media/media.stopRecord.md
@@ -0,0 +1,119 @@
+media.stopRecord
+================
+
+Stops recording an audio file.
+
+    media.stopRecord();
+
+
+Description
+-----------
+
+Function `media.stopRecord` is a synchronous function that stops recording an audio file.
+
+Supported Platforms
+-------------------
+
+- Android
+- iOS
+- Windows Phone 7 ( Mango )
+    
+Quick Example
+-------------
+
+    // Record audio
+    // 
+    function recordAudio() {
+        var src = "myrecording.mp3";
+        var mediaRec = new Media(src,
+            // success callback
+            function() {
+                console.log("recordAudio():Audio Success");
+            },
+            
+            // error callback
+            function(err) {
+                console.log("recordAudio():Audio Error: "+ err.code);
+            });
+
+        // Record audio
+        mediaRec.startRecord();
+
+        // Stop recording after 10 seconds
+        setTimeout(function() {
+            mediaRec.stopRecord();
+        }, 10000);
+    }
+
+
+Full Example
+------------
+
+    <!DOCTYPE html>
+    <html>
+      <head>
+        <title>Device Properties Example</title>
+
+        <script type="text/javascript" charset="utf-8" src="phonegap.js"></script>
+        <script type="text/javascript" charset="utf-8">
+
+        // Wait for PhoneGap to load
+        //
+        document.addEventListener("deviceready", onDeviceReady, false);
+
+        // Record audio
+        // 
+        function recordAudio() {
+            var src = "myrecording.mp3";
+            var mediaRec = new Media(src, onSuccess, onError);
+
+            // Record audio
+            mediaRec.startRecord();
+
+            // Stop recording after 10 sec
+            var recTime = 0;
+            var recInterval = setInterval(function() {
+                recTime = recTime + 1;
+                setAudioPosition(recTime + " sec");
+                if (recTime >= 10) {
+                    clearInterval(recInterval);
+                    mediaRec.stopRecord();
+                }
+            }, 1000);
+        }
+
+        // PhoneGap is ready
+        //
+        function onDeviceReady() {
+            recordAudio();
+        }
+    
+        // onSuccess Callback
+        //
+        function onSuccess() {
+            console.log("recordAudio():Audio Success");
+        }
+    
+        // onError Callback 
+        //
+        function onError(error) {
+            alert('code: '    + error.code    + '\n' + 
+                  'message: ' + error.message + '\n');
+        }
+
+        // Set audio position
+        // 
+        function setAudioPosition(position) {
+            document.getElementById('audio_position').innerHTML = position;
+        }
+
+        </script>
+      </head>
+      <body>
+        <p id="media">Recording audio...</p>
+        <p id="audio_position"></p>
+      </body>
+    </html>
+
+
+

http://git-wip-us.apache.org/repos/asf/incubator-cordova-docs/blob/69a280f2/docs/en/1.4.0/phonegap/notification/notification.alert.md
----------------------------------------------------------------------
diff --git a/docs/en/1.4.0/phonegap/notification/notification.alert.md b/docs/en/1.4.0/phonegap/notification/notification.alert.md
new file mode 100644
index 0000000..925c67a
--- /dev/null
+++ b/docs/en/1.4.0/phonegap/notification/notification.alert.md
@@ -0,0 +1,94 @@
+notification.alert
+==================
+
+Shows a custom alert or dialog box.
+
+    navigator.notification.alert(message, alertCallback, [title], [buttonName])
+
+- __message:__ Dialog message (`String`)
+- __alertCallback:__ Callback to invoke when alert dialog is dismissed. (`Function`)
+- __title:__ Dialog title (`String`) (Optional, Default: "Alert")
+- __buttonName:__ Button name (`String`) (Optional, Default: "OK")
+    
+Description
+-----------
+
+Most PhoneGap implementations use a native dialog box for this feature.  However, some platforms
simply use the browser's `alert` function, which is typically less customizable.
+
+Supported Platforms
+-------------------
+
+- Android
+- BlackBerry (OS 4.6)
+- BlackBerry WebWorks (OS 5.0 and higher)
+- iPhone
+- Windows Phone 7 ( Mango )
+
+Quick Example
+-------------
+
+    // Android / BlackBerry WebWorks (OS 5.0 and higher) / iPhone
+    //
+    function alertDismissed() {
+        // do something
+    }
+
+    navigator.notification.alert(
+        'You are the winner!',  // message
+        alertDismissed,         // callback
+        'Game Over',            // title
+        'Done'                  // buttonName
+    );
+
+    // BlackBerry (OS 4.6) / webOS
+    //
+    navigator.notification.alert('You are the winner!');
+        
+Full Example
+------------
+
+    <!DOCTYPE html>
+    <html>
+      <head>
+        <title>Notification Example</title>
+
+        <script type="text/javascript" charset="utf-8" src="phonegap.js"></script>
+        <script type="text/javascript" charset="utf-8">
+
+        // Wait for PhoneGap to load
+        //
+        document.addEventListener("deviceready", onDeviceReady, false);
+
+        // PhoneGap is ready
+        //
+        function onDeviceReady() {
+            // Empty
+        }
+    
+        // alert dialog dismissed
+	    function alertDismissed() {
+	        // do something
+	    }
+
+        // Show a custom alert
+        //
+        function showAlert() {
+		    navigator.notification.alert(
+		        'You are the winner!',  // message
+		        alertDismissed,         // callback
+		        'Game Over',            // title
+		        'Done'                  // buttonName
+		    );
+        }
+    
+        </script>
+      </head>
+      <body>
+        <p><a href="#" onclick="showAlert(); return false;">Show Alert</a></p>
+      </body>
+    </html>
+
+Windows Phone 7 Quirks
+-------------
+
+- Ignores button names, always uses 'OK' 
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-cordova-docs/blob/69a280f2/docs/en/1.4.0/phonegap/notification/notification.beep.md
----------------------------------------------------------------------
diff --git a/docs/en/1.4.0/phonegap/notification/notification.beep.md b/docs/en/1.4.0/phonegap/notification/notification.beep.md
new file mode 100644
index 0000000..4f97a05
--- /dev/null
+++ b/docs/en/1.4.0/phonegap/notification/notification.beep.md
@@ -0,0 +1,94 @@
+notification.beep
+=================
+
+The device will play a beep sound.
+
+    navigator.notification.beep(times);
+
+- __times:__ The number of times to repeat the beep (`Number`)
+
+Supported Platforms
+-------------------
+
+- Android
+- BlackBerry (OS 4.6)
+- BlackBerry WebWorks (OS 5.0 and higher)
+- iPhone
+- Windows Phone 7 ( Mango )
+
+Quick Example
+-------------
+
+    // Beep twice!
+    navigator.notification.beep(2);
+
+Full Example
+------------
+
+    <!DOCTYPE html>
+    <html>
+      <head>
+        <title>Notification Example</title>
+
+        <script type="text/javascript" charset="utf-8" src="phonegap.js"></script>
+        <script type="text/javascript" charset="utf-8">
+
+        // Wait for PhoneGap to load
+        //
+        document.addEventListener("deviceready", onDeviceReady, false);
+
+        // PhoneGap is ready
+        //
+        function onDeviceReady() {
+            // Empty
+        }
+
+        // Show a custom alert
+        //
+        function showAlert() {
+		    navigator.notification.alert(
+		        'You are the winner!',  // message
+		        'Game Over',            // title
+		        'Done'                  // buttonName
+		    );
+        }
+
+        // Beep three times
+        //
+        function playBeep() {
+            navigator.notification.beep(3);
+        }
+
+        // Vibrate for 2 seconds
+        //
+        function vibrate() {
+            navigator.notification.vibrate(2000);
+        }
+
+        </script>
+      </head>
+      <body>
+        <p><a href="#" onclick="showAlert(); return false;">Show Alert</a></p>
+        <p><a href="#" onclick="playBeep(); return false;">Play Beep</a></p>
+        <p><a href="#" onclick="vibrate(); return false;">Vibrate</a></p>
+      </body>
+    </html>
+
+Android Quirks
+--------------
+
+- Android plays the default "Notification ringtone" specified under the "Settings/Sound &
Display" panel.
+
+iPhone Quirks
+-------------
+
+- Ignores the beep count argument.
+- There is no native beep API for iPhone.
+  - PhoneGap implements beep by playing an audio file via the media API.
+  - The user must provide a file with the desired beep tone.
+  - This file must be less than 30 seconds long, located in the www/ root, and must be named
`beep.wav`.
+
+Windows Phone 7 Quirks
+-------------
+
+- WP7 PhoneGap lib includes a generic beep file that is used. 

http://git-wip-us.apache.org/repos/asf/incubator-cordova-docs/blob/69a280f2/docs/en/1.4.0/phonegap/notification/notification.confirm.md
----------------------------------------------------------------------
diff --git a/docs/en/1.4.0/phonegap/notification/notification.confirm.md b/docs/en/1.4.0/phonegap/notification/notification.confirm.md
new file mode 100755
index 0000000..3cb8dea
--- /dev/null
+++ b/docs/en/1.4.0/phonegap/notification/notification.confirm.md
@@ -0,0 +1,92 @@
+notification.confirm
+====================
+
+Shows a customizable confirmation dialog box.
+
+    navigator.notification.confirm(message, confirmCallback, [title], [buttonLabels])
+
+- __message:__ Dialog message (`String`)
+- __confirmCallback:__ - Callback to invoke with index of button pressed (1, 2 or 3). (`Number`)
+- __title:__ Dialog title (`String`) (Optional, Default: "Confirm")
+- __buttonLabels:__ Comma separated string with button labels (`String`) (Optional, Default:
"OK,Cancel")
+    
+Description
+-----------
+
+Function `notification.confirm` displays a native dialog box that is more customizable than
the browser's `confirm` function.
+
+Supported Platforms
+-------------------
+
+- Android
+- BlackBerry WebWorks (OS 5.0 and higher)
+- iPhone
+- Windows Phone 7 ( Mango )
+
+Quick Example
+-------------
+
+	// process the confirmation dialog result
+	function onConfirm(button) {
+		alert('You selected button ' + button);
+	}
+
+    // Show a custom confirmation dialog
+    //
+    function showConfirm() {
+        navigator.notification.confirm(
+	        'You are the winner!',  // message
+			onConfirm,				// callback to invoke with index of button pressed
+	        'Game Over',            // title
+	        'Restart,Exit'          // buttonLabels
+        );
+    }
+        
+Full Example
+------------
+
+    <!DOCTYPE html>
+    <html>
+      <head>
+        <title>Notification Example</title>
+
+        <script type="text/javascript" charset="utf-8" src="phonegap.js"></script>
+        <script type="text/javascript" charset="utf-8">
+
+        // Wait for PhoneGap to load
+        //
+        document.addEventListener("deviceready", onDeviceReady, false);
+
+        // PhoneGap is ready
+        //
+        function onDeviceReady() {
+            // Empty
+        }
+    
+		// process the confirmation dialog result
+		function onConfirm(button) {
+			alert('You selected button ' + button);
+		}
+
+        // Show a custom confirmation dialog
+        //
+        function showConfirm() {
+            navigator.notification.confirm(
+		        'You are the winner!',  // message
+				onConfirm,				// callback to invoke with index of button pressed
+		        'Game Over',            // title
+		        'Restart,Exit'          // buttonLabels
+            );
+        }
+    
+        </script>
+      </head>
+      <body>
+        <p><a href="#" onclick="showConfirm(); return false;">Show Confirm</a></p>
+      </body>
+    </html>
+
+Windows Phone 7 Quirks
+-------------
+
+- Ignores button names, always 'OK|Cancel'
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-cordova-docs/blob/69a280f2/docs/en/1.4.0/phonegap/notification/notification.md
----------------------------------------------------------------------
diff --git a/docs/en/1.4.0/phonegap/notification/notification.md b/docs/en/1.4.0/phonegap/notification/notification.md
new file mode 100644
index 0000000..6e7b7b9
--- /dev/null
+++ b/docs/en/1.4.0/phonegap/notification/notification.md
@@ -0,0 +1,12 @@
+Notification
+============
+
+> Visual, audible, and tactile device notifications.
+
+Methods
+-------
+
+- notification.alert
+- notification.confirm
+- notification.beep
+- notification.vibrate
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-cordova-docs/blob/69a280f2/docs/en/1.4.0/phonegap/notification/notification.vibrate.md
----------------------------------------------------------------------
diff --git a/docs/en/1.4.0/phonegap/notification/notification.vibrate.md b/docs/en/1.4.0/phonegap/notification/notification.vibrate.md
new file mode 100644
index 0000000..c556d3a
--- /dev/null
+++ b/docs/en/1.4.0/phonegap/notification/notification.vibrate.md
@@ -0,0 +1,84 @@
+notification.vibrate
+====================
+
+Vibrates the device for the specified amount of time.
+
+    navigator.notification.vibrate(milliseconds)
+
+- __time:__ Milliseconds to vibrate the device. 1000 milliseconds equals 1 second (`Number`)
+
+Supported Platforms
+-------------------
+
+- Android
+- BlackBerry (OS 4.6)
+- BlackBerry WebWorks (OS 5.0 and higher)
+- iPhone
+- Windows Phone 7
+
+Quick Example
+-------------
+
+    // Vibrate for 2.5 seconds
+    //
+    navigator.notification.vibrate(2500);
+
+Full Example
+------------
+    
+    <!DOCTYPE html>
+    <html>
+      <head>
+        <title>Notification Example</title>
+
+        <script type="text/javascript" charset="utf-8" src="phonegap.js"></script>
+        <script type="text/javascript" charset="utf-8">
+
+        // Wait for PhoneGap to load
+        //
+        document.addEventListener("deviceready", onDeviceReady, false);
+
+        // PhoneGap is ready
+        //
+        function onDeviceReady() {
+            // Empty
+        }
+    
+        // Show a custom alert
+        //
+        function showAlert() {
+		    navigator.notification.alert(
+		        'You are the winner!',  // message
+		        'Game Over',            // title
+		        'Done'                  // buttonName
+		    );
+        }
+    
+        // Beep three times
+        //
+        function playBeep() {
+            navigator.notification.beep(3);
+        }
+    
+        // Vibrate for 2 seconds
+        //
+        function vibrate() {
+            navigator.notification.vibrate(2000);
+        }
+
+        </script>
+      </head>
+      <body>
+        <p><a href="#" onclick="showAlert(); return false;">Show Alert</a></p>
+        <p><a href="#" onclick="playBeep(); return false;">Play Beep</a></p>
+        <p><a href="#" onclick="vibrate(); return false;">Vibrate</a></p>
+      </body>
+    </html>
+
+iPhone Quirks
+-------------
+
+- __time:__ Ignores the time and vibrates for a pre-set amount of time.
+
+        navigator.notification.vibrate();
+        navigator.notification.vibrate(2500);   // 2500 is ignored
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-cordova-docs/blob/69a280f2/docs/en/1.4.0/phonegap/storage/database/database.md
----------------------------------------------------------------------
diff --git a/docs/en/1.4.0/phonegap/storage/database/database.md b/docs/en/1.4.0/phonegap/storage/database/database.md
new file mode 100644
index 0000000..445a43c
--- /dev/null
+++ b/docs/en/1.4.0/phonegap/storage/database/database.md
@@ -0,0 +1,104 @@
+Database
+=======
+
+Contains methods that allow the user to manipulate the Database
+
+Methods
+-------
+
+- __transaction__: Runs a database transaction. 
+- __changeVersion__: method allows scripts to atomically verify the version number and change
it at the same time as doing a schema update. 
+
+Details
+-------
+
+A Database object is returned from a call to `window.openDatabase()`.
+
+Supported Platforms
+-------------------
+
+- Android
+- BlackBerry WebWorks (OS 6.0 and higher)
+- iPhone
+
+Transaction Quick Example
+------------------
+	function populateDB(tx) {
+		 tx.executeSql('DROP TABLE IF EXISTS DEMO');
+		 tx.executeSql('CREATE TABLE IF NOT EXISTS DEMO (id unique, data)');
+		 tx.executeSql('INSERT INTO DEMO (id, data) VALUES (1, "First row")');
+		 tx.executeSql('INSERT INTO DEMO (id, data) VALUES (2, "Second row")');
+	}
+	
+	function errorCB(err) {
+		alert("Error processing SQL: "+err.code);
+	}
+	
+	function successCB() {
+		alert("success!");
+	}
+	
+	var db = window.openDatabase("Database", "1.0", "PhoneGap Demo", 200000);
+	db.transaction(populateDB, errorCB, successCB);
+
+Change Version Quick Example
+-------------------
+
+	var db = window.openDatabase("Database", "1.0", "PhoneGap Demo", 200000);
+	db.changeVersion("1.0", "1.1");
+
+Full Example
+------------
+
+    <!DOCTYPE html>
+    <html>
+      <head>
+        <title>Contact Example</title>
+
+        <script type="text/javascript" charset="utf-8" src="phonegap.js"></script>
+        <script type="text/javascript" charset="utf-8">
+
+        // Wait for PhoneGap to load
+        //
+        document.addEventListener("deviceready", onDeviceReady, false);
+
+        // PhoneGap is ready
+        //
+        function onDeviceReady() {
+			var db = window.openDatabase("Database", "1.0", "PhoneGap Demo", 200000);
+			db.transaction(populateDB, errorCB, successCB);
+        }
+		
+		// Populate the database 
+		//
+		function populateDB(tx) {
+			 tx.executeSql('DROP TABLE IF EXISTS DEMO');
+			 tx.executeSql('CREATE TABLE IF NOT EXISTS DEMO (id unique, data)');
+			 tx.executeSql('INSERT INTO DEMO (id, data) VALUES (1, "First row")');
+			 tx.executeSql('INSERT INTO DEMO (id, data) VALUES (2, "Second row")');
+		}
+		
+		// Transaction error callback
+		//
+		function errorCB(tx, err) {
+			alert("Error processing SQL: "+err);
+		}
+		
+		// Transaction success callback
+		//
+		function successCB() {
+			alert("success!");
+		}
+	
+        </script>
+      </head>
+      <body>
+        <h1>Example</h1>
+        <p>Database</p>
+      </body>
+    </html>
+
+Android 1.X Quirks
+------------------
+
+- __changeVersion:__ This method is not support by Android 1.X devices.

http://git-wip-us.apache.org/repos/asf/incubator-cordova-docs/blob/69a280f2/docs/en/1.4.0/phonegap/storage/localstorage/localstorage.md
----------------------------------------------------------------------
diff --git a/docs/en/1.4.0/phonegap/storage/localstorage/localstorage.md b/docs/en/1.4.0/phonegap/storage/localstorage/localstorage.md
new file mode 100644
index 0000000..ab3a183
--- /dev/null
+++ b/docs/en/1.4.0/phonegap/storage/localstorage/localstorage.md
@@ -0,0 +1,91 @@
+localStorage
+===============
+
+Provides access to a W3C Storage interface (http://dev.w3.org/html5/webstorage/#the-localstorage-attribute)
+
+    var storage = window.localStorage;
+
+Methods
+-------
+
+- __key__: Returns the name of the key at the position specified. 
+- __getItem__: Returns the item identified by it's key.
+- __setItem__: Saves and item at the key provided.
+- __removeItem__: Removes the item identified by it's key.
+- __clear__: Removes all of the key value pairs.
+
+Details
+-----------
+
+localStorage provides an interface to a W3C Storage interface.  It allows one to save data
as key-value pairs.
+
+Supported Platforms
+-------------------
+
+- Android
+- BlackBerry WebWorks (OS 6.0 and higher)
+- iPhone
+
+Key Quick Example
+-------------
+
+    var keyName = window.localStorage.key(0);
+
+Set Item Quick Example
+-------------
+
+    window.localStorage.setItem("key", "value");
+
+Get Item Quick Example
+-------------
+
+	var value = window.localStorage.getItem("key");
+	// value is now equal to "value"
+
+Remove Item Quick Example
+-------------
+
+	window.localStorage.removeItem("key");
+
+Clear Quick Example
+-------------
+
+	window.localStorage.clear();
+
+Full Example
+------------
+
+    <!DOCTYPE html>
+    <html>
+      <head>
+        <title>Contact Example</title>
+
+        <script type="text/javascript" charset="utf-8" src="phonegap.js"></script>
+        <script type="text/javascript" charset="utf-8">
+
+        // Wait for PhoneGap to load
+        //
+        document.addEventListener("deviceready", onDeviceReady, false);
+
+        // PhoneGap is ready
+        //
+        function onDeviceReady() {
+			window.localStorage.setItem("key", "value");
+			var keyname = window.localStorage.key(i);
+			// keyname is now equal to "key"
+			var value = window.localStorage.getItem("key");
+			// value is now equal to "value"
+			window.localStorage.removeItem("key");
+			window.localStorage.setItem("key2", "value2");
+			window.localStorage.clear();
+			// localStorage is now empty
+        }
+    
+
+        </script>
+      </head>
+      <body>
+        <h1>Example</h1>
+        <p>localStorage</p>
+      </body>
+    </html>

http://git-wip-us.apache.org/repos/asf/incubator-cordova-docs/blob/69a280f2/docs/en/1.4.0/phonegap/storage/parameters/display_name.md
----------------------------------------------------------------------
diff --git a/docs/en/1.4.0/phonegap/storage/parameters/display_name.md b/docs/en/1.4.0/phonegap/storage/parameters/display_name.md
new file mode 100644
index 0000000..2adf459
--- /dev/null
+++ b/docs/en/1.4.0/phonegap/storage/parameters/display_name.md
@@ -0,0 +1,4 @@
+display_name
+==================
+
+The display name of the database.
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-cordova-docs/blob/69a280f2/docs/en/1.4.0/phonegap/storage/parameters/name.md
----------------------------------------------------------------------
diff --git a/docs/en/1.4.0/phonegap/storage/parameters/name.md b/docs/en/1.4.0/phonegap/storage/parameters/name.md
new file mode 100644
index 0000000..49e5afa
--- /dev/null
+++ b/docs/en/1.4.0/phonegap/storage/parameters/name.md
@@ -0,0 +1,4 @@
+name
+============
+
+The name of the database.
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-cordova-docs/blob/69a280f2/docs/en/1.4.0/phonegap/storage/parameters/size.md
----------------------------------------------------------------------
diff --git a/docs/en/1.4.0/phonegap/storage/parameters/size.md b/docs/en/1.4.0/phonegap/storage/parameters/size.md
new file mode 100644
index 0000000..78f66ab
--- /dev/null
+++ b/docs/en/1.4.0/phonegap/storage/parameters/size.md
@@ -0,0 +1,4 @@
+size
+==============
+
+The size of the database in bytes.
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-cordova-docs/blob/69a280f2/docs/en/1.4.0/phonegap/storage/parameters/version.md
----------------------------------------------------------------------
diff --git a/docs/en/1.4.0/phonegap/storage/parameters/version.md b/docs/en/1.4.0/phonegap/storage/parameters/version.md
new file mode 100644
index 0000000..fb6c5e1
--- /dev/null
+++ b/docs/en/1.4.0/phonegap/storage/parameters/version.md
@@ -0,0 +1,4 @@
+version
+=============
+
+The version of the database.

http://git-wip-us.apache.org/repos/asf/incubator-cordova-docs/blob/69a280f2/docs/en/1.4.0/phonegap/storage/sqlerror/sqlerror.md
----------------------------------------------------------------------
diff --git a/docs/en/1.4.0/phonegap/storage/sqlerror/sqlerror.md b/docs/en/1.4.0/phonegap/storage/sqlerror/sqlerror.md
new file mode 100644
index 0000000..9f12197
--- /dev/null
+++ b/docs/en/1.4.0/phonegap/storage/sqlerror/sqlerror.md
@@ -0,0 +1,28 @@
+SQLError
+========
+
+A `SQLError` object is thrown when an error occurs.
+
+Properties
+----------
+
+- __code:__ One of the predefined error codes listed below.
+- __message:__ A description of the error.
+
+Constants
+---------
+
+- `SQLError.UNKNOWN_ERR`
+- `SQLError.DATABASE_ERR`
+- `SQLError.VERSION_ERR`
+- `SQLError.TOO_LARGE_ERR`
+- `SQLError.QUOTA_ERR`
+- `SQLError.SYNTAX_ERR`
+- `SQLError.CONSTRAINT_ERR`
+- `SQLError.TIMEOUT_ERR`
+
+Description
+-----------
+
+The `SQLError` object is thrown when an error occurs when manipulating a database.
+

http://git-wip-us.apache.org/repos/asf/incubator-cordova-docs/blob/69a280f2/docs/en/1.4.0/phonegap/storage/sqlresultset/sqlresultset.md
----------------------------------------------------------------------
diff --git a/docs/en/1.4.0/phonegap/storage/sqlresultset/sqlresultset.md b/docs/en/1.4.0/phonegap/storage/sqlresultset/sqlresultset.md
new file mode 100644
index 0000000..bdc70b7
--- /dev/null
+++ b/docs/en/1.4.0/phonegap/storage/sqlresultset/sqlresultset.md
@@ -0,0 +1,115 @@
+SQLResultSet
+=======
+
+When the executeSql method of a SQLTransaction is called it will invoke it's callback with
a SQLResultSet.
+
+Properties
+-------
+
+- __insertId__: the row ID of the row that the SQLResultSet object's SQL statement inserted
into the database
+- __rowAffected__: the number of rows that were changed by the SQL statement.  If the statement
did not affect any rows then it is set to 0. 
+- __rows__: a SQLResultSetRowList representing the rows returned.  If no rows are returned
the object will be empty.
+
+Details
+-------
+
+When you call the SQLTransaction executeSql method it's callback methods will be called with
a SQLResultSet object.  The result object has three properties.  The first is the `insertId`
which will return the row number of a success SQL insert statement.  If the SQL statement
is not an insert then the `insertId` is not set.  The `rowAffected` is always 0 for a SQL
select statement.  For insert or update statements it returns the number of rows that have
been modified.  The final property is of type SQLResultSetList and it contains the data returned
from a SQL select statement.
+
+Supported Platforms
+-------------------
+
+- Android
+- BlackBerry WebWorks (OS 6.0 and higher)
+- iPhone
+
+Execute SQL Quick Example
+------------------
+
+	function queryDB(tx) {
+		tx.executeSql('SELECT * FROM DEMO', [], querySuccess, errorCB);
+	}
+
+	function querySuccess(tx, results) {
+		// this will be empty since no rows were inserted.
+		console.log("Insert ID = " + results.insertId);
+		// this will be 0 since it is a select statement
+		console.log("Rows Affected = " + results.rowAffected);
+		// the number of rows returned by the select statement
+		console.log("Insert ID = " + results.rows.length);
+	}
+	
+	function errorCB(err) {
+		alert("Error processing SQL: "+err.code);
+	}
+	
+	var db = window.openDatabase("Database", "1.0", "PhoneGap Demo", 200000);
+	db.transaction(queryDB, errorCB);
+
+Full Example
+------------
+
+    <!DOCTYPE html>
+    <html>
+      <head>
+        <title>Contact Example</title>
+
+        <script type="text/javascript" charset="utf-8" src="phonegap.js"></script>
+        <script type="text/javascript" charset="utf-8">
+
+        // Wait for PhoneGap to load
+        //
+        document.addEventListener("deviceready", onDeviceReady, false);
+
+		// Populate the database 
+		//
+		function populateDB(tx) {
+			tx.executeSql('DROP TABLE IF EXISTS DEMO');
+			tx.executeSql('CREATE TABLE IF NOT EXISTS DEMO (id unique, data)');
+			tx.executeSql('INSERT INTO DEMO (id, data) VALUES (1, "First row")');
+			tx.executeSql('INSERT INTO DEMO (id, data) VALUES (2, "Second row")');
+		}
+
+		// Query the database
+		//
+		function queryDB(tx) {
+			tx.executeSql('SELECT * FROM DEMO', [], querySuccess, errorCB);
+		}
+
+		// Query the success callback
+		//
+		function querySuccess(tx, results) {
+			// this will be empty since no rows were inserted.
+			console.log("Insert ID = " + results.insertId);
+			// this will be 0 since it is a select statement
+			console.log("Rows Affected = " + results.rowAffected);
+			// the number of rows returned by the select statement
+			console.log("Insert ID = " + results.rows.length);
+		}
+
+		// Transaction error callback
+		//
+		function errorCB(err) {
+			console.log("Error processing SQL: "+err.code);
+		}
+
+		// Transaction success callback
+		//
+		function successCB() {
+			var db = window.openDatabase("Database", "1.0", "PhoneGap Demo", 200000);
+			db.transaction(queryDB, errorCB);
+		}
+
+		// PhoneGap is ready
+		//
+		function onDeviceReady() {
+			var db = window.openDatabase("Database", "1.0", "PhoneGap Demo", 200000);
+			db.transaction(populateDB, errorCB, successCB);
+		}
+	
+        </script>
+      </head>
+      <body>
+        <h1>Example</h1>
+        <p>Database</p>
+      </body>
+    </html>

http://git-wip-us.apache.org/repos/asf/incubator-cordova-docs/blob/69a280f2/docs/en/1.4.0/phonegap/storage/sqlresultsetlist/sqlresultsetlist.md
----------------------------------------------------------------------
diff --git a/docs/en/1.4.0/phonegap/storage/sqlresultsetlist/sqlresultsetlist.md b/docs/en/1.4.0/phonegap/storage/sqlresultsetlist/sqlresultsetlist.md
new file mode 100644
index 0000000..cff4faa
--- /dev/null
+++ b/docs/en/1.4.0/phonegap/storage/sqlresultsetlist/sqlresultsetlist.md
@@ -0,0 +1,116 @@
+SQLResultSetList
+=======
+
+One of the properties of the SQLResultSet containing the rows returned from a SQL query.
+
+Properties
+-------
+
+- __length__: the number of rows returned by the SQL query
+
+Methods
+-------
+
+- __item__: returns the row at the specified index represented by a JavaScript object.
+
+Details
+-------
+
+The SQLResultSetList contains the data returned from a SQL select statement.  The object
contains a length property letting you know how many rows the select statement has been returned.
 To get a row of data you would call the `item` method specifing an index.  The item method
returns a JavaScript Object who's properties are the columns of the database the select statement
was executed against.
+
+Supported Platforms
+-------------------
+
+- Android
+- BlackBerry WebWorks (OS 6.0 and higher)
+- iPhone
+
+Execute SQL Quick Example
+------------------
+
+	function queryDB(tx) {
+		tx.executeSql('SELECT * FROM DEMO', [], querySuccess, errorCB);
+	}
+
+	function querySuccess(tx, results) {
+		var len = results.rows.length;
+	���	console.log("DEMO table: " + len + " rows found.");
+	���	for (var i=0; i<len; i++){
+	����	console.log("Row = " + i + " ID = " + results.rows.item(i).id + " Data =  "
+ results.rows.item(i).data);
+		}
+	}
+	
+	function errorCB(err) {
+		alert("Error processing SQL: "+err.code);
+	}
+	
+	var db = window.openDatabase("Database", "1.0", "PhoneGap Demo", 200000);
+	db.transaction(queryDB, errorCB);
+
+Full Example
+------------
+
+    <!DOCTYPE html>
+    <html>
+      <head>
+        <title>Contact Example</title>
+
+        <script type="text/javascript" charset="utf-8" src="phonegap.js"></script>
+        <script type="text/javascript" charset="utf-8">
+
+        // Wait for PhoneGap to load
+        //
+        document.addEventListener("deviceready", onDeviceReady, false);
+
+		// Populate the database 
+		//
+		function populateDB(tx) {
+			tx.executeSql('DROP TABLE IF EXISTS DEMO');
+			tx.executeSql('CREATE TABLE IF NOT EXISTS DEMO (id unique, data)');
+			tx.executeSql('INSERT INTO DEMO (id, data) VALUES (1, "First row")');
+			tx.executeSql('INSERT INTO DEMO (id, data) VALUES (2, "Second row")');
+		}
+
+		// Query the database
+		//
+		function queryDB(tx) {
+			tx.executeSql('SELECT * FROM DEMO', [], querySuccess, errorCB);
+		}
+
+		// Query the success callback
+		//
+		function querySuccess(tx, results) {
+			var len = results.rows.length;
+			console.log("DEMO table: " + len + " rows found.");
+			for (var i=0; i<len; i++){
+				console.log("Row = " + i + " ID = " + results.rows.item(i).id + " Data =  " + results.rows.item(i).data);
+			}
+		}
+
+		// Transaction error callback
+		//
+		function errorCB(err) {
+			console.log("Error processing SQL: "+err.code);
+		}
+
+		// Transaction success callback
+		//
+		function successCB() {
+			var db = window.openDatabase("Database", "1.0", "PhoneGap Demo", 200000);
+			db.transaction(queryDB, errorCB);
+		}
+
+		// PhoneGap is ready
+		//
+		function onDeviceReady() {
+			var db = window.openDatabase("Database", "1.0", "PhoneGap Demo", 200000);
+			db.transaction(populateDB, errorCB, successCB);
+		}
+	
+        </script>
+      </head>
+      <body>
+        <h1>Example</h1>
+        <p>Database</p>
+      </body>
+    </html>

http://git-wip-us.apache.org/repos/asf/incubator-cordova-docs/blob/69a280f2/docs/en/1.4.0/phonegap/storage/sqltransaction/sqltransaction.md
----------------------------------------------------------------------
diff --git a/docs/en/1.4.0/phonegap/storage/sqltransaction/sqltransaction.md b/docs/en/1.4.0/phonegap/storage/sqltransaction/sqltransaction.md
new file mode 100644
index 0000000..07403dc
--- /dev/null
+++ b/docs/en/1.4.0/phonegap/storage/sqltransaction/sqltransaction.md
@@ -0,0 +1,93 @@
+SQLTransaction
+=======
+
+Contains methods that allow the user to execute SQL statements against the Database.
+
+Methods
+-------
+
+- __executeSql__: executes a SQL statement
+
+Details
+-------
+
+When you call a Database objects transaction method it's callback methods will be called
with a SQLTransaction object.  The user can build up a database transaction by calling the
executeSql method multiple times.  
+
+Supported Platforms
+-------------------
+
+- Android
+- BlackBerry WebWorks (OS 6.0 and higher)
+- iPhone
+
+Execute SQL Quick Example
+------------------
+
+	function populateDB(tx) {
+		 tx.executeSql('DROP TABLE IF EXISTS DEMO');
+		 tx.executeSql('CREATE TABLE IF NOT EXISTS DEMO (id unique, data)');
+		 tx.executeSql('INSERT INTO DEMO (id, data) VALUES (1, "First row")');
+		 tx.executeSql('INSERT INTO DEMO (id, data) VALUES (2, "Second row")');
+	}
+	
+	function errorCB(err) {
+		alert("Error processing SQL: "+err);
+	}
+	
+	function successCB() {
+		alert("success!");
+	}
+	
+	var db = window.openDatabase("Database", "1.0", "PhoneGap Demo", 200000);
+	db.transaction(populateDB, errorCB, successCB);
+
+Full Example
+------------
+
+    <!DOCTYPE html>
+    <html>
+      <head>
+        <title>Contact Example</title>
+
+        <script type="text/javascript" charset="utf-8" src="phonegap.js"></script>
+        <script type="text/javascript" charset="utf-8">
+
+        // Wait for PhoneGap to load
+        //
+        document.addEventListener("deviceready", onDeviceReady, false);
+
+        // PhoneGap is ready
+        //
+        function onDeviceReady() {
+			var db = window.openDatabase("Database", "1.0", "PhoneGap Demo", 200000);
+			db.transaction(populateDB, errorCB, successCB);
+        }
+		
+		// Populate the database 
+		//
+		function populateDB(tx) {
+			 tx.executeSql('DROP TABLE IF EXISTS DEMO');
+			 tx.executeSql('CREATE TABLE IF NOT EXISTS DEMO (id unique, data)');
+			 tx.executeSql('INSERT INTO DEMO (id, data) VALUES (1, "First row")');
+			 tx.executeSql('INSERT INTO DEMO (id, data) VALUES (2, "Second row")');
+		}
+		
+		// Transaction error callback
+		//
+		function errorCB(err) {
+			alert("Error processing SQL: "+err);
+		}
+		
+		// Transaction success callback
+		//
+		function successCB() {
+			alert("success!");
+		}
+	
+        </script>
+      </head>
+      <body>
+        <h1>Example</h1>
+        <p>SQLTransaction</p>
+      </body>
+    </html>

http://git-wip-us.apache.org/repos/asf/incubator-cordova-docs/blob/69a280f2/docs/en/1.4.0/phonegap/storage/storage.md
----------------------------------------------------------------------
diff --git a/docs/en/1.4.0/phonegap/storage/storage.md b/docs/en/1.4.0/phonegap/storage/storage.md
new file mode 100644
index 0000000..cc24a79
--- /dev/null
+++ b/docs/en/1.4.0/phonegap/storage/storage.md
@@ -0,0 +1,29 @@
+Storage
+==========
+
+> Provides access to the devices storage options.  
+
+This API is based on the [W3C Web SQL Database Specification](http://dev.w3.org/html5/webdatabase/)
and [W3C Web Storage API Specification](http://dev.w3.org/html5/webstorage/). Some devices
already provide an implementation of this spec. For those devices, the built-in support is
used instead of replacing it with PhoneGap's implementation. For devices that don't have storage
support, PhoneGap's implementation should be compatible with the W3C specification.
+
+Methods
+-------
+
+- openDatabase
+
+Arguments
+---------
+
+- name
+- version
+- display_name
+- size
+
+Objects
+-------
+
+- Database
+- SQLTransaction
+- SQLResultSet
+- SQLResultSetList
+- SQLError
+- localStorage
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-cordova-docs/blob/69a280f2/docs/en/1.4.0/phonegap/storage/storage.opendatabase.md
----------------------------------------------------------------------
diff --git a/docs/en/1.4.0/phonegap/storage/storage.opendatabase.md b/docs/en/1.4.0/phonegap/storage/storage.opendatabase.md
new file mode 100644
index 0000000..fa63748
--- /dev/null
+++ b/docs/en/1.4.0/phonegap/storage/storage.opendatabase.md
@@ -0,0 +1,54 @@
+openDatabase
+===============
+
+Returns a new Database object.
+
+    var dbShell = window.openDatabase(name, version, display_name, size);
+
+Description
+-----------
+
+window.openDatabase returns a new Database object.
+
+This method will create a new SQL Lite Database and return a Database object.  Use the Database
Object to manipulate the data.
+
+Supported Platforms
+-------------------
+
+- Android
+- BlackBerry WebWorks (OS 6.0 and higher)
+- iPhone
+
+Quick Example
+-------------
+
+    var db = window.openDatabase("test", "1.0", "Test DB", 1000000);
+
+Full Example
+------------
+
+    <!DOCTYPE html>
+    <html>
+      <head>
+        <title>Contact Example</title>
+
+        <script type="text/javascript" charset="utf-8" src="phonegap.js"></script>
+        <script type="text/javascript" charset="utf-8">
+
+        // Wait for PhoneGap to load
+        //
+        document.addEventListener("deviceready", onDeviceReady, false);
+
+        // PhoneGap is ready
+        //
+        function onDeviceReady() {
+			var db = window.openDatabase("test", "1.0", "Test DB", 1000000);
+        }
+		
+        </script>
+      </head>
+      <body>
+        <h1>Example</h1>
+        <p>Open Database</p>
+      </body>
+    </html>


Mime
View raw message