I am using jquery with jqtouch to develop a mobile web application.
My app uses ajax to poll the server. Now, with the iPhone, if the browser window looses focus, JavaScript stops running (and hence polling as well), and restarts only when it regains focus.
However, with the Android browser (I am testing with a Nexus One = Android 2.1), JavaScripts keeps on running, and so the polling continues as well. This is undesirable, especially as applications (ie the browser in this case) usually stay open on a mobile.
I thought I could solve this issue by binding blur and focus events to the window, to stop and restart polling, respectively. This works fine on the desktop, but the events aren't fired with the Android browser.
Does anyone how to find out in the Android browser if the window has focus?
PS I hope my post is in the right forum, as it doesn't seem there is mobile / jqtouch forum.