How to explicitly disable GPS from strength/Gym App

for whatever reason, the GPS is still turning on why I do a session recording.
In the permissions part of the manifest, I didn't put GPS as a requirement, but the app still takes GPS for a gym session.

Then I tried a diff tactic which is to request for GPS permission and then in the onstart() and onstop() functions, I put in GPS disabled.

I tot that if I were at least request for NO GPS, then it would not turn on. But it still does.

How does people here go about deliberately disabling GPS? (This is for my Gym/Set timer app)

Thanks.
  • Maybe the question wasn't framed properly.
    How does one go about enabling and disabling the GPS feature from an app?

    I see that in some apps - they have a menu that will explicitly not start GPS.
    Something like the native Indoor running app.

    I would like to do that and disable GPS.
  • Former Member
    Former Member over 9 years ago
    If you don't enable position events in an App, GPS will be off.

    If you enable position events, GPS will turn on. When you disable those events, the GPS will turn off.
  • function onStart() {
    GPS.enableLocationEvents( GPS.LOCATION_DISABLE, method(:onPosition));
    }

    // onStop() is called when your application is exiting
    function onStop() {
    GPS.enableLocationEvents( GPS.LOCATION_DISABLE, method(:onPosition));



    I tried the above (requested permission for GPS) but explicitly disabled it, but still get a location fix after the data is sync'ed up to GC
  • If you don't make the call at all in onStart, that would disable GPS. Seems you need to only make the call if you are using GPS. So after you decide if GPS is to be used, make the enable call, and if you're not using GPS, don't make the call at all.

    It could be that even though you disable GPS in onStart, the underlying recording thinks your using GPS, but you don't want the callback for onPosition.
  • I actually tried both instances.
    Meaning - one where I requeted for GPS In the manifest and anothe Where I did not.
    It still ended up as taking my position once uploaded to GC
  • But what if you don't make the call in onStart()? (comment out that line...)
  • I vaguely remember that if you pass null as the listener parameter (the second one), that will disable GPS. Of course GPS is disabled by default, so if you never enable it (as suggested above by Jim), that should work as well.