javascript - Cordova PhoneGap upgrade to 5.1.1 from 2.2.0 -
i have cordova application version 2.2.0. want upgrade, have done upgrade part, after upgrading, application images not display, came blank screen. splash screen not came. here code
now reached level. have simulated application, sqliteplugin
issue. when open database db.cordova not define
how database installation - copy database db folder android installation location. worked fine.
this database:
var db = new object(); db.isdbsupported = false; db.isdbcreated = false; db.vocabdb = null; db.tables = ['userresponses', 'wordgroups', 'words', 'wordmapping', 'checkexists', 'patch_version'] db.createdtables = 0; db.setupcallback = null; db.curqp = null; db.accountstatus = false; db.sfx = true; db.showwarnings = true; db.firstlaunch = false; db.initdb = function(callback) { this.setupcallback = callback || function(){/*console.log("null function called")*/}; this.opendb(); var db = this; if(!isphonegap()) { _.delay(this.checkdb.bind(this), 500); } } db.checkdb = function() { var db = this; this.vocabdb.transaction( function (t) { t.executesql('drop table checkexists', [], db.setupdbresulthandler.bind(db), db.setupdberrorhandler.bind(db, ">>delete exists")) } ) } db.opendb = function() { try { if (!window.opendatabase) { alert('cannot open database!'); } else { var shortname = 'sns2'; var version = '1.0'; var displayname = 'sns2'; var maxsize = (isandroid()) ? 5242880 : 1000000; if(!isphonegap()) { this.vocabdb = window.opendatabase(shortname, version, displayname, maxsize, this.dbcreated); } else if(isandroid()) { utils.log("android database .. "); this.vocabdb = window.sqliteplugin.opendatabase(shortname, version, displayname, maxsize, this.dbcreated); } else if(isios()) { utils.log("ios database .. "); this.vocabdb = window.sqliteplugin.opendatabase(shortname, version, displayname, maxsize, this.dbcreated); } this.dbsupported = true; if(isphonegap()) { this.setupcallback(); } } } catch(e) { alert("unable open db." + e.message); return; } }
service.js
function getgroupcategory(handler) { console.log("selecting wordgroups"); db.vocabdb .transaction(function(t) { t .executesql('select * categories', [], function(transaction, resultset) { handler(transaction, resultset); }, db.transactionerrorhandler .bind(db, "error while selecting wordgroups")); }) }
when called method got error message could not prepare statement(1 no such table) error code 5
table avaibale
please suggestion or idea..
i suggest start clean 5.1.1. way can prevent problems may caused upgrading whole thing, , keep searching root of problems.
this might sound more work, pretty sure less of hassle upgrading, @ least personal experience taught me phonegap.
Comments
Post a Comment