1. #161
    Sencha Premium Member
    Join Date
    Oct 2012
    Location
    Antibes
    Posts
    66
    Vote Rating
    0
    Gaspard22 is on a distinguished road

      0  

    Default 0000000000000001.db seems to have an error

    0000000000000001.db seems to have an error


    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
    i got this launching the sqlitedemo, someone knows why ?

  2. #162
    Sencha Premium Member vadimv's Avatar
    Join Date
    Sep 2010
    Location
    Chisinau, Moldova
    Posts
    642
    Vote Rating
    25
    vadimv will become famous soon enough vadimv will become famous soon enough

      0  

    Default


    @jastako
    T
    hat example is ok. What problems did you have ?
    @Gaspard22
    W
    hy not to user ST's proxy, is much better written, bet is faster, easy to use, and has support.

  3. #163
    Sencha Premium Member
    Join Date
    Oct 2012
    Location
    Antibes
    Posts
    66
    Vote Rating
    0
    Gaspard22 is on a distinguished road

      0  

    Default


    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.

  4. #164
    Sencha Premium Member vadimv's Avatar
    Join Date
    Sep 2010
    Location
    Chisinau, Moldova
    Posts
    642
    Vote Rating
    25
    vadimv will become famous soon enough vadimv will become famous soon enough

      0  

    Default


    Quote Originally Posted by Gaspard22 View Post
    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.
    You can use it for SQLite too, on native, see my previous post with the override.

  5. #165
    Sencha Premium Member vadimv's Avatar
    Join Date
    Sep 2010
    Location
    Chisinau, Moldova
    Posts
    642
    Vote Rating
    25
    vadimv will become famous soon enough vadimv will become famous soon enough

      0  

    Default


    Quote Originally Posted by Gaspard22
    Is the Sql proxy would work only with the plugin ?

    Using phonegap 2.20 api not sufficient ?
    yes, only with a phonegap plugin.

  6. #166
    Sencha User
    Join Date
    Jan 2012
    Posts
    21
    Vote Rating
    0
    jastako is on a distinguished road

      0  

    Default


    @vadimv, here's my code:

    First I define my proxy which returns native SQLite DB (not the WebSQL's one):

    Code:
    Ext.define 'MyApp.data.proxy.Sql',
      extend: 'Ext.data.proxy.SQL'
      alias: 'proxy.myapp-sql'
    
      getDatabaseObject: ->
        return Globals.getDb()
    Globals.getDb() returns device's native SQLite DB obtained with Brody Spark's PhoneGap SQLite plugin (https://github.com/brodyspark/PhoneG...Plugin-Android). This variabl

    Then if assured, that DB is ready (right after PhoneGap's successful initialization) following method is executed:

    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
    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.

    I'm really happy to use Simon's proxy, but also really crazy about native solution.

  7. #167
    Sencha Premium Member vadimv's Avatar
    Join Date
    Sep 2010
    Location
    Chisinau, Moldova
    Posts
    642
    Vote Rating
    25
    vadimv will become famous soon enough vadimv will become famous soon enough

      0  

    Default


    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.

  8. #168
    Sencha User
    Join Date
    Jan 2012
    Posts
    21
    Vote Rating
    0
    jastako is on a distinguished road

      0  

    Default


    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.

  9. #169
    Sencha User
    Join Date
    May 2012
    Posts
    6
    Vote Rating
    0
    Qumhieh is on a distinguished road

      0  

    Default 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

  10. #170
    Sencha User
    Join Date
    Jan 2012
    Posts
    21
    Vote Rating
    0
    jastako is on a distinguished road

      0  

    Default


    Quote Originally Posted by Qumhieh View Post
    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
    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.