mirror of
https://github.com/moparisthebest/PhoneGap-SQLitePlugin-Android
synced 2024-08-13 15:53:46 -04:00
Reproduce #18/#38 for Android in test program in README.md
This commit is contained in:
parent
eeccf33db8
commit
6194a6b4fc
@ -186,15 +186,16 @@ Sample change to res/xml/config.xml:
|
|||||||
|
|
||||||
Make a change like this to index.html to run a small test program to verify the installation is OK:
|
Make a change like this to index.html to run a small test program to verify the installation is OK:
|
||||||
|
|
||||||
--- index.html.old 2012-07-23 22:05:21.000000000 +0200
|
--- index.html.old 2012-08-04 14:40:07.000000000 +0200
|
||||||
+++ assets/www/index.html 2012-07-23 22:43:42.000000000 +0200
|
+++ assets/www/index.html 2012-08-04 14:36:05.000000000 +0200
|
||||||
@@ -24,7 +24,32 @@
|
@@ -24,7 +24,35 @@
|
||||||
<title>PhoneGap</title>
|
<title>PhoneGap</title>
|
||||||
<link rel="stylesheet" href="master.css" type="text/css" media="screen" title="no title">
|
<link rel="stylesheet" href="master.css" type="text/css" media="screen" title="no title">
|
||||||
<script type="text/javascript" charset="utf-8" src="cordova-2.0.0.js"></script>
|
<script type="text/javascript" charset="utf-8" src="cordova-2.0.0.js"></script>
|
||||||
- <script type="text/javascript" charset="utf-8" src="main.js"></script>
|
- <script type="text/javascript" charset="utf-8" src="main.js"></script>
|
||||||
+ <script type="text/javascript" charset="utf-8" src="SQLitePlugin.js"></script>
|
+ <script type="text/javascript" charset="utf-8" src="SQLitePlugin.js"></script>
|
||||||
+
|
+
|
||||||
|
+
|
||||||
+ <script type="text/javascript" charset="utf-8">
|
+ <script type="text/javascript" charset="utf-8">
|
||||||
+ document.addEventListener("deviceready", onDeviceReady, false);
|
+ document.addEventListener("deviceready", onDeviceReady, false);
|
||||||
+ function onDeviceReady() {
|
+ function onDeviceReady() {
|
||||||
@ -205,6 +206,8 @@ Make a change like this to index.html to run a small test program to verify the
|
|||||||
+ tx.executeSql('CREATE TABLE IF NOT EXISTS test_table (id integer primary key, data text, data_num integer)');
|
+ tx.executeSql('CREATE TABLE IF NOT EXISTS test_table (id integer primary key, data text, data_num integer)');
|
||||||
+
|
+
|
||||||
+ tx.executeSql("INSERT INTO test_table (data, data_num) VALUES (?,?)", ["test", 100], function(tx, res) {
|
+ tx.executeSql("INSERT INTO test_table (data, data_num) VALUES (?,?)", ["test", 100], function(tx, res) {
|
||||||
|
+ console.log("insertId: " + res.insertId + " -- probably 1");
|
||||||
|
+ alert("insertId: " + res.insertId + " -- should be valid"); // reproduce #18/#38
|
||||||
+
|
+
|
||||||
+ db.transaction(function(tx) {
|
+ db.transaction(function(tx) {
|
||||||
+ tx.executeSql("SELECT data_num from test_table;", [], function(tx, res) {
|
+ tx.executeSql("SELECT data_num from test_table;", [], function(tx, res) {
|
||||||
|
Loading…
Reference in New Issue
Block a user