I am developing a simple Phonegap based app for Android that uses setInterval for some featuers as well as accelerometer for some gestures. I am testing it on 3 different devices and suddenly all features that are in any way related to setInterval function (including accelerometer) stopped working on one of my devices (Samsung Galaxy 5 i5500). First I thought there is a hardware failure but all my other apps and also games still work on this device, even with accelerometer. I can not even get the example running from
http://docs.phonegap.com/en/2.0.0/cordova_accelerometer_accelerometer.md.html#Accelerometer.
When I execute
var watchID = navigator.accelerometer.watchAcceleration(onSuccess, onError, options);
it returns watchID but never executes function onSuccess() ...
I already tried everything:
- app data from phone, uninstalling app
- switching to different version of Phonegap (I tried v1.5, 1.8.1, 1.9 and 2.0)
- resetting phone to factory defaults
- using newer version of Eclipse
- I also created a new "hello world" application that includes only setInterval example
etc.
...and the setInterval() still won't fire... Here's the code that is called on device ready event:
setInterval(intervalFunction, 1000);
function intervalFunction() {
console.log("inerval...");
}
This intervalFunction() never gets executed on i5500 (but it was working a few days ago). But I must point out again that it works on other devices and also other (non-phonegap accelerometer apps) work correctly on i5500.
Does anybody have a same issue? Is there any way to get rid of this?