Delayed response to click/touch events in app resuming from background on i0S5

You must Login before you can answer or comment on any questions.

I developed an app using Titanium 1.7.3 and Xcode 5, and I noticed that when I resume an app running in background on iOS5 there is about a 5 second delay before the app responds to touch or click events.

Has anyone experienced this behavior?

7 Answers

Is it possible to display a splash screen when the app resumes until the UI becomes active? Using the pause/resume event listeners to display a splash window is ineffective because they are also delayed when the app resumes.

— answered 2 years ago by Niel Vanterpool
answer permalink
1 Comment
  • There is an app called Momento that does this. I don't think it was made with titanium. I would like to know if this is possible as well. I don't mind displaying a screen till the app is functional again.

    — commented 2 years ago by Leonardo Amigoni

I solved the problem by turning off analytics in the tiapp.xml file. Can anyone explain why this happens when analytics is turned on?

— answered 2 years ago by Niel Vanterpool
answer permalink
1 Comment
  • Hi

    Can you please tell me how to stop the analytics as i don't want my user to use Internet just because of that and even the app is causing little delay on any touch or click event.

    Regards

    Nikunj

    — commented 2 years ago by Nikunj S

Open the tiapp.xml file and change the line

<analytics>true</analytics>

to

<analytics>false</analytics>

— answered 2 years ago by Niel Vanterpool
answer permalink
2 Comments
  • I'm not totally sure how it works, but Analytics logs data and is then sent back to Appcelerator. However, from what I read, this only happens when your app is packaged for distribution.

    — commented 2 years ago by Darren Adams

  • This fixed my issue as well. I'm really curious to know why removing analytics fixes the issue... Thanks!!!

    — commented 1 year ago by Jay Aguilar

I have seen this in a number of apps both titanium made and not... thats not saying titanium does not have an issue here, but rather that I think the core of the issue might be iOS5. If you can get more of a use case, that might help track down if their is an issue on the titanium side.

Yea I get this all the time.. frustrating, because then people start clicking and clicking and clicking and sometimes an uncaught exception occurs and the app falls over. Great huh.

— answered 2 years ago by P Sweeney
answer permalink
5 Comments
  • Again, if you can post a use case, that would be very helpful in tracking down the issue.

    — commented 2 years ago by Matt Apperson

  • It's happening to basically all apps I develop, without providing any specific code (as it's not possible to track it down to any one element).

    — commented 2 years ago by P Sweeney

  • As I am not able to repeat it with the default app that is generated on a new project, and I have not replicated it for any apps that my team or myself have created... I need a code sample of some kind to show the issue.

    — commented 2 years ago by Matt Apperson

  • Show 2 more comments

I'll give you an example of how the scenario looks at the moment.

  • app.js
  • New Window -> Login
  • New Window -> Split Window
  • Master Window -> Contains 1 Image (320x90) and 4-7 Labels
  • Detail Window -> Contains one image 704x704
  • (Click on Label in Master View -> New Window Opens)
  • New Modal Window -> Contains Images (representing gallery)
  • Close Modal Window
  • --- Delay of a few seconds ---
  • (Put app, on an iPad, not in the simulator, into the background, leave a while and come back, and you experience this delay).

That's effectively a perfect scenario to replicate this, as that's, element by element, one of the apps that produces this (but effectively all apps seem to experience this, and they all use different sources!).

— answered 2 years ago by P Sweeney
answer permalink
1 Comment
  • Have you tested the KitchenSink app on your device to see if you are getting the same behavior?

    — commented 2 years ago by Niel Vanterpool

I haven't bothered because it would be a fairly inconclusive test seeing as eliminating the kitchen sink won't prove it's the code or the framework or the iOS. Too many variables to make an accurate analysis.

— answered 2 years ago by P Sweeney
answer permalink
1 Comment
  • Gotcha. I've recently adopted the practice of coding my applications in a single Javascript context which is different from the way the KitchenSink is implemented. I'm wondering if this has any impact...

    — commented 2 years ago by Niel Vanterpool

Your Answer

Think you can help? Login to answer this question!