Titanium Community Questions & Answer Archive

We felt that 6+ years of knowledge should not die so this is the Titanium Community Questions & Answer Archive

XML to local DB

I am writing an app that pulls content from an XML feed. I would like the app usable regardless of network connection (iPod Touch users).

Can I capture an XML feed and dump it to either a local file or a local sqlite db? Also, what about testing the network connection and only updating when available?

— asked March 12th 2010 by Jeremy Flint
  • network
  • sqlite
  • xml
0 Comments

2 Answers

  • Yes, take a look at the KitchenSink example file, "xhr_xml.js" and then any of the database.js files. That should help you out.

    Run a check of the internet connection. Update the database accordingly (fill/update).

    Then run a loop and insert all the data from the database in the tablerows

    The db type is SQLite3+.

    — answered March 12th 2010 by John Welch
    permalink
    0 Comments
  • Also, these may be useful:

    Online Status (bool): Titanium.Network.online<br>
    Network Type (string): Titanium.Network.networkTypeName

    — answered March 12th 2010 by John Welch
    permalink
    0 Comments
The ownership of individual contributions to this community generated content is retained by the authors of their contributions.
All trademarks remain the property of the respective owner.