1. #1
    Sencha User
    Join Date
    Sep 2012
    Posts
    5
    Vote Rating
    0
    amitkgupta28 is on a distinguished road

      0  

    Default Unanswered: Sencha Touch Local Storage

    Unanswered: Sencha Touch Local Storage


    I am a newbie on Sencha Touch. Here is my case:

    I have around a database base of cars ( cars, manufacturer, photos etc ) which I would like to display using Sencha Touch application. There are going to be around 3000 objects. This data will be displayed in a Sencha Touch Carousel. I do not want fetch from server during run time. Can you suggest me on how to store and access this database ? I will be making some queries as well ( for example - list car with manufacturer X, date < Y ). I was planning to store this entire data in JSON format in some file in the application which I could have accessed through LocalStorage but that won't give me flexibility of querying.

    Thanks in advance for the help.

  2. #2
    Sencha User
    Join Date
    Jan 2012
    Location
    London, UK
    Posts
    498
    Answers
    25
    Vote Rating
    51
    shepsii has a spectacular aura about shepsii has a spectacular aura about shepsii has a spectacular aura about

      0  

    Default


    Mmmm.... 3000 objects is a tough one.

    Theoretically, what you can do is pull in all the data into a store, and then filter that store (this would be the equivalent to querying).

    However, I had a very similar database size for an app last year (I was storing every NFL player, around 2000 in total) and performance really struggled on phones, as they just didn't have enough memory.

    The problem is, Sencha Touch does not like a local store that doesn't immediately hold all the data. I also found that just storing the data raw in the memory as a javascript object is incomparable to storing it in a sencha touch store. The store has a ton of overheads it seems and these are what slows things down. Just the data in memory alone, does not slow things down to a material extent.

    So in the end what I did, was I wrote a Sencha Touch class that had some basic filter/query methods on it that operated over the raw javascript data, and returned stores of no more than 50 or so items at a time. This worked really well, even on quite an old and low spec Android 2.x phone. I'd be happy to share the file I wrote with you if you PM me your email.

    The other challenge you might face is updating that data, which it would be best to have in a JSON file. If you're running a webapp best plan is just to have a CRON job on the server that overwrites the JSON file, if you're going native it gets trickier...

  3. #3
    Sencha User
    Join Date
    Sep 2012
    Posts
    5
    Vote Rating
    0
    amitkgupta28 is on a distinguished road

      0  

    Default


    Thanks for the reply. Your answer was enlightening I am sent you my email address via PM.

    What was the problem you faced while using SQLite ? Does Sencha Touch not support SQLite ?

Thread Participants: 1

Tags for this Thread

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..." hd porno faketaxi