Saving Xml response on Local (iOS)

9 posts, 0 answers
  1. Keen
    Keen avatar
    101 posts
    Member since:
    Mar 2013

    Posted 27 May 2013 Link to this post

    Hi
       I'm creating a apps that connected to a web service. everything is fine. But I want to save the xml response to local? Im targeting iOS device.
    Is there any suggestion? or any sample apps that saving xml response to local storage of iOS device?
  2. Steve
    Admin
    Steve avatar
    10941 posts

    Posted 28 May 2013 Link to this post

    Hello Keen,

    Take a look at this answer to a forum post about the same inquiry.

    Regards,
    Steve
    Telerik

    Don't miss the Icenium May Release Keynote - sign up now!
    Share feedback and vote for features on our Feedback Portal.
  3. Chris
    Chris avatar
    1 posts
    Member since:
    Aug 2010

    Posted 28 May 2013 Link to this post

    Hi Keen,

    The easiest way to save an xml response locally is by using "window.localStorage" (http://docs.phonegap.com/en/2.5.0/cordova_storage_storage.md.html#localStorage). It's a persistent key-value store.
    E.g.
    localStorage.setItem("webServiceResponse", webServiceResponse);

    However, if you want to store the result as a file (and not as a string in a key-value store or a DB), you'd better use Cordova's local FileSystem API: http://docs.phonegap.com/en/2.5.0/cordova_file_file.md.html

    Hope this information helps.

    Chris
  4. Keen
    Keen avatar
    101 posts
    Member since:
    Mar 2013

    Posted 29 May 2013 Link to this post

    Hi chris,
      I successfully get the xml response and see in the simulator that it was stored in Localstorage section. Thanks for the help. Im trying to parse it.

    I hope jquery mobile will not be slow.
  5. Keen Mark
    Keen Mark avatar
    7 posts
    Member since:
    May 2013

    Posted 30 May 2013 Link to this post

    hey guys i received this message 
    1. Uncaught Error: QUOTA_EXCEEDED_ERR: DOM Exception 22 XXXXXX.js:155
      1. GetRecipeDetailSuccess1CALCMENU.js:155
      2. st.Callbacks.fjquery-1.9.1.min.js:1
      3. st.Callbacks.p.fireWithjquery-1.9.1.min.js:1
      4. rjquery-1.9.1.min.js:3
      5. st.ajaxTransport.send.r
    Does Local storage has a limit size of storage ?
  6. Keen
    Keen avatar
    101 posts
    Member since:
    Mar 2013

    Posted 30 May 2013 Link to this post

    hey guys i received this message 


    Uncaught Error: QUOTA_EXCEEDED_ERR: DOM Exception 22 XXXXXX.js:155

    GetXXXXXXxXXXXXXXXXXXXX1XXXXXXx.js:155
    st.Callbacks.fjquery-1.9.1.min.js:1
    st.Callbacks.p.fireWithjquery-1.9.1.min.js:1
    rjquery-1.9.1.min.js:3
    st.ajaxTransport.send.r
    Does Local storage has a limit ?
  7. Steve
    Admin
    Steve avatar
    10941 posts

    Posted 31 May 2013 Link to this post

    Hello Keen,

    HTML5 WebStorage suffers from different implementation on different platforms. Mobile Platforms & Browsers combinations differs in size of memory (disk space) quota assigned to each website. As per the W3 documentation:

    A mostly arbitrary limit of five megabytes per origin is recommended. Implementation feedback is welcome and will be used to update this suggestion in the future.

    If you really need a large space in your application, you should consider using HTML Web SQL Database or SQLite via the support SQLite plugin (clone the sample demo here).

    Regards,
    Steve
    Telerik

    Don't miss the Icenium May Release Keynote - sign up now!
    Share feedback and vote for features on our Feedback Portal.
  8. Keen
    Keen avatar
    101 posts
    Member since:
    Mar 2013

    Posted 02 Jun 2013 Link to this post

    Hi Steve,

    Using the HTML Web SQL Database what is the size limit ? and also using the SQLite?
  9. Steve
    Admin
    Steve avatar
    10941 posts

    Posted 03 Jun 2013 Link to this post

    Hello Keen,

    WebSQL limitation is around 5MB as well, so you're pretty much bound to use the SQLite plugin for more storage space. You can find more information about the plugin here and for working sample refer to the sample-sqlite.

    Regards,
    Steve
    Telerik

    Don't miss the Icenium May Release Keynote - sign up now!
    Share feedback and vote for features on our Feedback Portal.
Back to Top