-
21 Dec 2012 3:00 AM #161
0000000000000001.db seems to have an error
0000000000000001.db seems to have an error
i got this launching the sqlitedemo, someone knows why ?Code:SQLite format 3@ -‚% ¸ R ∫U Rf!%%ÅtablepeoplepeopleCREATE TABLE people(name TEXT)É!yyÑAtable__WebKitDatabaseInfoTable____WebKitDatabaseInfoTable__CREATE TABLE __WebKitDatabaseInfoTable__ (key TEXT NOT NULL ON CONFLICT FAIL UNIQUE ON CONFLICT REPLACE,value TEXT NOT NULL ON CONFLICT FAIL)Å$!ÅEyindexsqlite_autoindex___WebKitDatabaseInfoTable___1__WebKitDatabaseInfoTable__ √√;mWebKitDatabaseVersionKey1.19 ÃÃ3m WebKitDatabaseVersionKey
-
21 Dec 2012 6:11 AM #162
@jastako
That example is ok. What problems did you have ?
@Gaspard22
Why not to user ST's proxy, is much better written, bet is faster, easy to use, and has support.My blog: http://vadimpopa.com
-
21 Dec 2012 6:27 AM #163
correct me if i'm wrong
ST proxy is for websql, and websql have a 5 Mo limitation right ?
this project's for an native app in IOS.
-
21 Dec 2012 7:00 AM #164
My blog: http://vadimpopa.com
-
21 Dec 2012 7:11 AM #165
yes, only with a phonegap plugin.
Originally Posted by Gaspard22
My blog: http://vadimpopa.com
-
21 Dec 2012 3:09 PM #166
@vadimv, here's my code:
First I define my proxy which returns native SQLite DB (not the WebSQL's one):
Globals.getDb() returns device's native SQLite DB obtained with Brody Spark's PhoneGap SQLite plugin (https://github.com/brodyspark/PhoneG...Plugin-Android). This variablCode:Ext.define 'MyApp.data.proxy.Sql', extend: 'Ext.data.proxy.SQL' alias: 'proxy.myapp-sql' getDatabaseObject: -> return Globals.getDb()
Then if assured, that DB is ready (right after PhoneGap's successful initialization) following method is executed:
And here's the thing. If I use Simon's proxy, everything works just fine, while ST's native one is not working for me whatsoever. List view, which is supposed to be populated by given store is empty in ST's proxy case. I even recently tried to rename DB table names to fit my model names instead of specifying table name in the code, but with no success.Code:setProxy: (store) -> if not @databaseReady # Some error handling here and exit. return table_name = 'some_table' if on # Simon Shepherd's (3rd-party) SQLite proxy: store.setProxy type: 'sqlitestorage' dbConfig: tablename: table_name dbConn: dbConn: Globals.getDb() else # ST's native SQLite proxy: store.setProxy type: 'myapp-sql' table: table_name
I'm really happy to use Simon's proxy, but also really crazy about native solution.
-
25 Dec 2012 1:13 AM #167
I just add that override and the proxy config in the store define and that's it, don't set anything after phonegap ready, very simple. And yes you must map the database tables to models, the names must be exactly and the fields also. Also first test on websql and if works then for sure that on native will work too, with websql developing is much faster. And if you get sth strange, better to delete the databases, from time to time. Try to make a basic app with one model, once will work will be much easier for you with your app.
One more, first load ST code then Cordova.
EDIT: I see that you are on Android, probably aren't problems with its plugins, but as I'm working on iOS I can assure you that on iOS works.My blog: http://vadimpopa.com
-
25 Dec 2012 8:17 AM #168
I used to develop using Chrome and its WebSQL native solution as it speeds up dev. process greatly. From time to time deploy to device to confirm everything works on target. Bearing this in mind I well tested ST's proxy in both environments. Will try as you suggested from simple hello world and then act accordingly.
-
26 Dec 2012 2:33 AM #169
Storage size limit
Storage size limit
Hey
what is the storage size limit? cuz my app stuck if i increase the storage size over than 50MB
(freeze in both webview and after i do the native packaging)
any help please
-
26 Dec 2012 3:31 PM #170
Have you allocated whole DB in memory? If so, you most likely exceeded memory limit per app. On Android it varies from 16 to 48 MB depending on OS version and device itself (how much RAM it is capable of). Don't know anything about iOS and how it can be overcome in both OSes, but I'm pretty sure Google knows something about it.


Reply With Quote