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?
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+.
-
Also, these may be useful:
Online Status (bool): Titanium.Network.online<br>
Network Type (string): Titanium.Network.networkTypeName