Software Archive
Read-only legacy content
17061 Discussions

Web App delay to take clicks [SOLVED]

Diego_Calp
Valued Contributor I
383 Views

Good afternoon,

I've created a web app using XDK and after load in browser it takes several seconds to respond to clics. Tested in several browsers and OSs, same all places.

It has around 50 mp3 files linked to HTML5 player, all set with preload = "none"

Here is the link, try the Menu button at top left corner:

http://www.soledadsacheri.com.ar/app

The app build for android works fine, the button respond as son as it is displayed.

Thanks a lot for your comments,

Regards

Diego

0 Kudos
7 Replies
Hamilton_Tenório_da_
Valued Contributor I
383 Views

I am developing just now my first web app using XDK. The same issue.

I found in \www\xdk\init-dev.js:

// Defines some delays constants used throughout for ready detections.
// Each should be smaller than the next; most cases should work as is.
// Lowering dev.BROWSER will speed up detection of browser scenario...
// ...at expense of possible false detects of browser environment...
// ...probably okay to go as low as 3000ms, depends on external libraries, etc.

dev.INSURANCE = 250 ;                   // ms, insurance on registering ready events detected
dev.WINDOW_LOAD = 500 ;                 // ms, for combating premature window load events
dev.BROWSER = 7000 ;                    // ms, detecting in a browser (probably best at >5 seconds)
dev.FAIL_SAFE = 10000 ;                 // ms, if all else fails, this saves our bacon :-)

I am thinking to change these delays, but I am not sure what happens...

Is there any orientation about it?

0 Kudos
PaulF_IntelCorp
Employee
383 Views

Diego and Hamilton, change the lines that Hamilton found in the init-dev.js file to this:

// Defines some delays constants used throughout for ready detections.
// Each should be smaller than the next; most cases should work as is.
// Lowering dev.BROWSER speeds up detection of browser scenario...
// ...at expense of possible false detects of browser environment...
// ...probably okay to go as low as 3000ms, depends on external libraries, etc.
// dev.NAME = dev.NAME || ## ; allows for override of values in index.html

if( typeof window.cordova !== "undefined" ) // if real cordova.js is present, we should detect a "deviceready"...
    dev.BROWSER = dev.BROWSER || 7000 ;     // ...best if >5 seconds when Cordova is expected to be present

dev.INSURANCE = dev.INSURANCE || 250 ;      // msecs, insurance on registering ready events detected
dev.WINDOW_LOAD = dev.WINDOW_LOAD || 500 ;  // msecs, for combating premature window load events
dev.BROWSER = dev.BROWSER || 500 ;          // msecs, non-Cordova apps don't care about "deviceready" events
dev.FAIL_SAFE = dev.FAIL_SAFE || 10000 ;    // msecs, if all else fails, this saves our bacon :-)

That should get rid of the delay.

0 Kudos
PaulF_IntelCorp
Employee
383 Views

Note that the variables are all designed to check if they are previously defined, which means that you can also define them in your index.html before that script file is loaded and override there, as well (or directly within the JS file, whatever works best for you). If you want to take that approach, you would do something like this in your index.html file:

<script type="text/javascript">
    window.dev = window.dev || {} ; 
    dev.BROWSER = 250 ;
</script>
<script src="xdk/init-dev.js"></script>

 

0 Kudos
Hamilton_Tenório_da_
Valued Contributor I
383 Views

Great! Now it is working like a charm... Thank you.

0 Kudos
Diego_Calp
Valued Contributor I
383 Views

Solved! Thank you very much Paul

Regards

Diego

0 Kudos
Vinicius
Beginner
383 Views

Worked perfectly! Hope Intel change it in the next versions! Thank you all.
 

0 Kudos
Gio_M_
Beginner
383 Views

Hi Diego. I have been trying to get in touch with you but it looks I can't send you a private message. Can you PM thru here?

Thanks,

 

Gio

0 Kudos
Reply