This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (localStorage.getItem("dbCreated") != true) { | |
html5sql.openDatabase("ScratchDB", "Scratch DB", 3 * 1024 * 1024); | |
var request = new XMLHttpRequest(); | |
request.open("GET", "file:///android_asset/www/create.sql", true); | |
request.onreadystatechange = function(){ | |
if (request.readyState == 4) { | |
if (request.status == 200 || request.status == 0) { | |
html5sql.process(request.responseText, | |
function(){ | |
console.log("Win!"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE TABLE example (id INTEGER PRIMARY KEY, data TEXT); | |
INSERT INTO example (data) VALUES ('First'); | |
INSERT INTO example (data) VALUES ('Second'); | |
INSERT INTO example (data) VALUES ('Third'); | |
CREATE TABLE example2 (id INTEGER PRIMARY KEY, data TEXT); | |
INSERT INTO example2 (data) VALUES ('First'); | |
INSERT INTO example2 (data) VALUES ('Second'); | |
INSERT INTO example2 (data) VALUES ('Third'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var fileTransfer = new FileTransfer(); | |
fileTransfer.download( | |
"http://developer.android.com/assets/images/home/ics-android.png", | |
"/sdcard/ics.png", | |
function(entry) { | |
console.log("download complete: " + entry.fullPath); | |
}, | |
function(error) { | |
console.log("download error source " + error.source); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE HTML> | |
<html> | |
<head> | |
<meta name="viewport" content="user-scalable=no" /> | |
<meta http-equiv="Content-type" content="text/html; charset=utf-8"> | |
<title>PhoneGap</title> | |
<style type="text/css"> | |
@media all and (min-width: 801px) { | |
#wrapper { | |
width: 80%; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE HTML> | |
<html> | |
<head> | |
<meta name="viewport" content="width=320; user-scalable=no" /> | |
<meta http-equiv="Content-type" content="text/html; charset=utf-8"> | |
<title>PhoneGap Config Example</title> | |
<link rel="stylesheet" href="master.css" type="text/css" media="screen" title="no title" charset="utf-8"> | |
<script type="text/javascript" charset="utf-8" src="phonegap-1.3.0.js"></script> | |
<script type="text/javascript" charset="utf-8"> | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE HTML> | |
<html> | |
<head> | |
<meta name="viewport" content="width=320; user-scalable=yes" /> | |
<meta http-equiv="Content-type" content="text/html; charset=utf-8"> | |
<title>PhoneGap</title> | |
<script type="text/javascript" charset="utf-8" src="cordova-1.5.0.js"></script> | |
<script type="text/javascript" charset="utf-8" src="video.js"></script> | |
<script type="text/javascript"> | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE HTML> | |
<html> | |
<head> | |
<meta name = "viewport" content = "user-scalable=no,width=device-width" /> | |
<meta http-equiv="Content-type" content="text/html; charset=utf-8"> | |
<title>Test Page</title> | |
<script type="text/javascript" charset="utf-8" src="cordova.android.js"></script> | |
<style type="text/css"> | |
* { | |
-webkit-tap-highlight-color: rgba(0, 0, 0, 0); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var IMEI = function(){}; | |
IMEI.prototype.get = function(onSuccess, onFail){ | |
return cordova.exec(onSuccess, onFail, 'IMEI', 'get', []); | |
}; | |
cordova.addConstructor(function(){ | |
cordova.addPlugin('imei', new IMEI()); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.simonmacdonald.imei; | |
import org.json.JSONArray; | |
import android.content.Context; | |
import android.telephony.TelephonyManager; | |
import com.phonegap.api.Plugin; | |
import com.phonegap.api.PluginResult; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.simonmacdonald.imei; | |
import org.json.JSONArray; | |
import android.content.Context; | |
import android.telephony.TelephonyManager; | |
import org.apache.cordova.api.Plugin; | |
import org.apache.cordova.api.PluginResult; |