Database undefined error in phonegap android?
I got same problem when was new to phonegap.Try this ,
var db = window.openDatabase("sgpw", "1.0", "PhoneGap Demo", 200000); document.addEventListener("deviceready", onDeviceReady, false);function onDeviceReady() { db.transaction(populateDB, transaction_error, populateDB_success);}
This will then call populateDB
function.
If error comes then will call transaction_error
.
If successful then will call populateDB_success
function.