Titanium Community Questions & Answer Archive

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

Checking For Updates On Start (Synchronous)

Hello,
I'm looking for an example that will allow me to check for updates before loading the rest of the program. Basically a Synchronous method, or allow it to trigger a function after it has checked.

— asked March 26th 2010 by Bryce Wilkinson
  • desktop
  • update
0 Comments

4 Answers

  • Almost nothing in the iPhone SDK happens synchronously, so you'll have to use a semaphore. Or just have the result of your process trigger your startup code.

    Basically, you'll want to draw a simple screen with an activity indicator (see the Kitchen Sink for this) and have that screen do your update checking. When that completes (in the event handler that processes the results) you'll open the main window of the app.

    — answered March 27th 2010 by Mark Burggraf
    permalink
    0 Comments
  • This is for desktop. Thanks though.

    — answered March 27th 2010 by Bryce Wilkinson
    permalink
    0 Comments
  • Hey Bryce, it's possible to use Titanium.Network.HTTPClient synchronously ( http://developer.appcelerator.com/apidoc/desktop/1.0/Titanium.Network.HTTPClient.open.html ). The UpdateManager doesn't support synchronous ussge. That being said, I wouldn't recommend using it. HTTP requests can take quite a while to complete and the UI will hang and be unresponsive during that entire time. Perhaps there is another way to accomplish what you want?

    — answered March 27th 2010 by Martin Robinson
    permalink
    0 Comments
  • Martin, do you have an example of how I could use Onupdate. I will try and work with async.

    — answered March 27th 2010 by Bryce Wilkinson
    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.