Simple structured data: json/xml file or sqllite?

6 posts, 0 answers
  1. Andres
    Andres avatar
    30 posts
    Member since:
    Apr 2013

    Posted 28 Apr 2013 Link to this post

    Hi all,
    im doing a simple app that load data from local that need to be ordered and grouped in the app. in sql terms, itś just a "table", in json terms a file with different fields.
    SO i wonder between using json file or sql lite. But im not sure if "$.ajax or getJson methods" can take data from local.
  2. Jordan
    Admin
    Jordan avatar
    197 posts

    Posted 01 May 2013 Link to this post

    Hi Andres,

    Yes the jQuery.getJSON will work fine with local files as log as you use relative path to the file.

    Just made you a quick sample project you can clone from GitHub within Icenium from here:
    https://github.com/jordanilchev/icenium-get-json-from-local.git

    Greetings,
    Jordan
    the Telerik team

    Share feedback and vote for features on our Feedback Portal.
    Want some Kendo UI online training - head over to Kendo UI Dojo.
  3. Andres
    Andres avatar
    30 posts
    Member since:
    Apr 2013

    Posted 04 May 2013 Link to this post

    Thanks Jordan.

    I will use your example to populate a database into SQLLite.
    In my app i will need to do some query, more easy with SQLlite that with internal json.

    I have been trying html5sql to populate data from sql statements, but it failed often.

    SO better read and internal json with data and build "insert" stataments for SQL Lite,

    Thanks
  4. Andres
    Andres avatar
    30 posts
    Member since:
    Apr 2013

    Posted 08 May 2013 Link to this post

    HI,
    I just made an app that shows a listview reading from SQLLite.
    The listview show, basically, a sql query. (select a field). But the app does a query each time user click a button or does a search. Also, first query is always slow.
    I wonder if it´s better just to read a local json, like in your example, and use listview to automatically filter results.

    is there a possibility to do this with jquery?Load the data in 1 listview (no more than 900 rows) and by example

    Button1 (animals) - show a new screen with listview sorted by animals
    Button2(plants) ´- show a listview with plants.

    Im not sure if just using sqllitee
  5. David Silveria
    David Silveria avatar
    234 posts
    Member since:
    May 2006

    Posted 09 May 2013 Link to this post

    Database operations are usually instantaneous, so speed wise, there should not be much of a difference. You can consider working with prepopulated db instead, and just use the sort of the listview, check out http://simonmacdonald.blogspot.com/2011/12/on-fourth-day-of-phonegapping-creating.html
  6. Andres
    Andres avatar
    30 posts
    Member since:
    Apr 2013

    Posted 16 May 2013 Link to this post

    Thanks, it works pretty good.
    I got some problems with "delete" operations, so i was duplicating database.

    I just complete a 100% offline app with SQL lite, and using also autocomplete in a local database.
    It just take a couple of seconds to populate 1000 columns in a Galaxy S2
Back to Top