Rob, I think my original question was somewhat clear and the code I pasted is very basic. Seems like a simple question for the Corona people.
The only thing I see that’s suspicious is that you’re turning on a listener, and then immediately removing it after the event fires. If the GPS errors along the way, you don’t remove the listener and it will keep firing. When you change scenes that code may not be around for the event handler to run and it could cause an error. I also don’t know of the underling GPS code is designed to be churned like that. Also your two timer handles are global variables and perhaps that’s creating your issues.
Rob
I’m super new to corona and I think my 15+ years of programming is hurting me more than helping me. A task that should be simple is over complicated with every process in lua. Leaving a scene should stop the scene without additional work on our end. Now, if we want something to stay alive than we should address it. Not the other way around that’s just silliness.
Would you suggest that I activate the location and just let it run every few seconds? I guess doing this would allow me to obtain and send the info when I need it. My worry with that is it may drain the users battery. However from what I’ve read when the app is out of view or closed the GPS won’t run. On my Galaxy S3 the GPS stay alive in the notifications bar when which leads me to believe it’s still running.
The GPS should not run while it’s backgrounded. I would start it and let it update as it does. Then just run your timer to transmit your data every 15 seconds.
Rob
Thank you Rob, almost have it now.