Did anyone try this configuration:
ST 2.1 + PhoneGap 2.2 + PhoneGap-SQLitePlugin (by chbrody: https://github.com/chbrody/Cordova-SQLitePlugin/) + SQLite Proxy by Shepsii
on Android?
It gives me following log, using weinre (http://people.apache.org/~pmuellr/weinre/docs/latest/):
Code:
SQLitePlugin
SQLitePlugin.prototype.open
DB opened: warsaw-ztm
MyApp.utils.Globals#updateDb
MyApp.controller.screen.BusStopSelection#onDatabaseReady
SQLitePluginTransaction - this.trans_id:1355429776541000
SQLitePluginTransaction.prototype.executeSql
success not null:SELECT sql FROM sqlite_master WHERE name=?
executeSql - add_to_transactionSELECT sql FROM sqlite_master WHERE name=?
SQLitePluginTransaction.prototype.complete
SQLitePluginTransaction.queryCompleteCallback
executeSql callback:[{"sql":"CREATE TABLE bus_stops_complexes (\n\tcomplex INTEGER NOT NULL, \n\tname VARCHAR NOT NULL, \n\tcity VARCHAR NOT NULL, \n\tPRIMARY KEY (complex)\n)"}]
SQLitePluginTransaction.prototype.executeSql
success not null:SELECT * FROM bus_stops_complexes LIMIT 1
executeSql - add_to_transactionSELECT * FROM bus_stops_complexes LIMIT 1
SQLitePluginTransaction.prototype.complete
SQLitePluginTransaction.queryCompleteCallback
executeSql callback:[{"complex":"1001","city":"Warszawa","name":"Kijowska"}]
processMessage failed: Message: J SQLitePluginTransaction.queryCompleteCallback('1355429776541000','1355429776553000', [{"complex":"1001","city":"Warszawa","name":"Kijowska"}]);
processMessage failed: Error: TypeError: Cannot call method 'getFields' of null
processMessage failed: Stack: TypeError: Cannot call method 'getFields' of null
at [object Object].getDbFields (file:///android_asset/www/deps/touch/3rd-party/SqliteStorage.js:293:16)
at file:///android_asset/www/deps/touch/3rd-party/SqliteStorage.js:228:29
at file:///android_asset/www/deps/touch/3rd-party/SqliteStorage.js:217:10
at Object.callback (file:///android_asset/www/deps/SQLitePlugin.js:167:16)
at Function.queryCompleteCallback (file:///android_asset/www/deps/SQLitePlugin.js:82:60)
at eval at processMessage (file:///android_asset/www/deps/cordova-2.2.0.js:1062:26)
at processMessage (file:///android_asset/www/deps/cordova-2.2.0.js:1062:13)
at Function.processMessages (file:///android_asset/www/deps/cordova-2.2.0.js:1123:17)
at Object.androidExec [as exec] (file:///android_asset/www/deps/cordova-2.2.0.js:985:21)
at [object Object].complete (file:///android_asset/www/deps/SQLitePlugin.js:212:20)
Given that PhoneGap is available to use after 'deviceready' signal, I've postponed DB init:
Code:
onDatabaseReady: ->
console.log Ext.getDisplayName(arguments.callee)
busStopsComplexesStore = Ext.getStore 'BusStopsComplexes'
if on
# shepsii sqlite proxy:
busStopsComplexesStore.setProxy
type: 'sqlitestorage'
dbConfig:
tablename: 'bus_stops_complexes'
dbConn:
dbConn: GetEverywhere.utils.Globals.getDb()
reader:
type: 'array'
else
# Sencha built-in sqlite proxy:
busStopsComplexesStore.setProxy
type: 'ge-sql'
table: 'bus_stops_complexes'
database: GetEverywhere.utils.Globals.getDb()
What I'm trying simply to accomplish is populate list view with rows from given table. Any clues?
EDIT:
I've linked my app against ST2.0 and now it works just fine. Hopefully I won't be using any fancy functionality available from ST2.1 in the future.