Skip to content

Instantly share code, notes, and snippets.

@macdonst
macdonst / gist:937307
Created April 22, 2011 18:28
Opendatabase issue on Android 3.0
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>Contact Example</title>
<script type="text/javascript" charset="utf-8" src="phonegap.0.9.4.js"></script>
<script type="text/javascript" charset="utf-8">
// Wait for PhoneGap to load
@macdonst
macdonst / gist:937315
Created April 22, 2011 18:30
SECURITY_ERR from openDatabase
E/Web Console( 1791): SECURITY_ERR: DOM Exception 18: An attempt was made to break through the security policy of the user agent. at file:///android_asset/www/db.html:64
@macdonst
macdonst / back.html
Created May 4, 2011 16:14
PhoneGap Android Back Button Example
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>PhoneGap Back Button Example</title>
<script type="text/javascript" charset="utf-8" src="phonegap.0.9.5.js"></script>
<script type="text/javascript" charset="utf-8">
// Call onDeviceReady when PhoneGap is loaded.
@macdonst
macdonst / speech.html
Created May 9, 2011 16:02
PhoneGap Android TTS Plugin Example
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>PhoneGap Events Example</title>
<script type="text/javascript" charset="utf-8" src="phonegap.0.9.5.js"></script>
<script type="text/javascript" charset="utf-8" src="tts.js"></script>
<script type="text/javascript" charset="utf-8">
@macdonst
macdonst / read.js
Created May 10, 2011 15:49
Read a file with new File API
function readArabic() {
window.requestFileSystem(LocalFileSystem.PERSISTENT, 0, getFS, fail);
}
function getFS(fileSystem) {
fileSystem.root.getFile("articals.txt", {"create":false, "exclusive":false}, gotArticals, fail);
}
function gotArticals(fileEntry) {
fileEntry.file(getFile, fail);
@macdonst
macdonst / audio.html
Created May 18, 2011 19:48
PhoneGap Media Class Example
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>PhoneGap Back Button Example</title>
<script type="text/javascript" charset="utf-8" src="phonegap.0.9.5.js"></script>
<script type="text/javascript" charset="utf-8">
var myMedia = null;
@macdonst
macdonst / AndroidManifest.xml
Created May 26, 2011 16:18
AndroidManifest.xml
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.testapp"
android:versionCode="1"
android:versionName="1.0">
<uses-sdk android:minSdkVersion="7" />
<supports-screens
android:largeScreens="true"
android:normalScreens="true"
android:smallScreens="true"
@macdonst
macdonst / cb.html
Created September 9, 2011 15:47
ChildBrowser Example
<!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>Child Browser 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.0.0.js"></script>
<script type="text/javascript" charset="utf-8" src="childbrowser.js"></script>
<script type="text/javascript" charset="utf-8">
@macdonst
macdonst / contact_example.html
Created September 21, 2011 01:48
Contact Save Example
<!DOCTYPE html>
<html>
<head>
<title>Contact Example</title>
<script type="text/javascript" charset="utf-8" src="phonegap-1.0.0.js"></script>
<script type="text/javascript" charset="utf-8">
// Wait for PhoneGap to load
//
@macdonst
macdonst / index.html
Created December 2, 2011 20:53
BarcodeScanner Android Example
<!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</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.2.0.js"></script>
<script type="text/javascript" charset="utf-8" src="barcodescanner.js"></script>
<script type="text/javascript" charset="utf-8">