Titanium Community Questions & Answer Archive

We felt that 6+ years of knowledge should not die so this is the Titanium Community Questions & Answer Archive

Turn off GPS after use?

To get a decent location you have to add an event listener on location and wait for a couple of events. However, there doesn't seem to be a straight forward way to turn it off. The closest I have found is some old documentation, but the API has changed drastically since then. I don't want to drain the users battery, 3 events is fine…I'm not tracking just locating them.

— asked August 10th 2010 by Mike Robinson
  • disable
  • gps
  • turn-off

1 Answer

  • Removing the event listener for 'location' will turn off the radio

    For example:
    Ti.Geolocation.removeEventListener('location', OnLocation);

    Of course, your function name may not be 'OnLocation'.

    If you are using 'heading' then that event listener should also be turned off.

    — answered December 7th 2011 by Pete Berry
The ownership of individual contributions to this community generated content is retained by the authors of their contributions.
All trademarks remain the property of the respective owner.