GPS cuts out sporadically (android)
In my app which uses GPS, and in the kitchensink geolocation app itself, the GPS appears to sporadically turn on and off. On my driod if I watch the status bar I can see the gps radio icon go on and off. Compare this to googles navigation app for android which turns the gps radio on and leaves it on.
The fact that the radio goes off and on almost religiously leads me to believe that it may be a bug. It always comes back online very quickly, but sometimes while it is offline it causes my tracking app to skip steps.
Can someone confirm what might be causing this to happen?
4 Answers
-
Look in the Trace level log to see what might be occurring.
-
Added ticket: https://appcelerator.lighthouseapp.com/projects/32238-titanium-mobile/tickets/2139-gps-cuts-out-sporadically
-
In case anyone runs across this, attached is the ticket for this in lighthouse. Still no love though, this one is driving me nuts:
https://appcelerator.lighthouseapp.com/projects/32238/tickets/2139-gps-cuts-out-sporadically
And the code:
http://pastie.org/1248564
-
This is not documented but I found that setting "Ti.Geolocation.frequency=1;" solves this problem. The default appears to be 5. From the best I can tell, this is the number of seconds between cycles. Make sure to do this before adding the 'heading' and 'location' event listeners.