Titanium Community Questions & Answer Archive

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

Background threads, eg. for synchronization?

I'm storing user entered information locally on the phone first, then uploading / synchronizing with the website. This allows me to provide offline data entry, to be sync'd once web access is available.

I'd like to drop the info to be sync'd on a synchronization queue of some sort (currently just stored as Ti.App.Properties), and have a background thread pick up the data and sync it.

What are good strategies for background threads/work, for example to provide synchronization?

— asked September 8th 2010 by Parand Darugar
  • mobile
  • mutli-threads

1 Answer

  • You could use the httpclient for this.
    It's async, so it does not block the app while performing what you need.

    You might want to add some "buffering" mechanism in case your user changes some data while the sync is in progress, and of course a timestamp to your data( but i think you already have this :) ).

    — answered September 8th 2010 by Dan Tamas
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.