Does GPS draw power even when the signal is weak?

I already have a guess for the answer to that question but I want to make sure. If I make an application that enables location events and I keep it running all the time, is the GPS module going to consume lots of energy even if the signal is very weak (indoors), or does it have a built-in mechanism that decreases the power draw in such cases?

If the answer is yes then I have another problem; I made an application that disables location events when the accuracy is less than or equal to 2 to make it energy-effienct. I added a counter in the callback method that receives the position object just to see how many position objects it receives over time.  However, The application often fails to detect a change in signal when I go indoors. I am currently running the app and it says the accuracy is 4 even though the callback method is not being invoked (the counter stopped), indicating an absence of a GPS signal. Did I do something wrong? the watch I am using is Vivoactive 4.

This is my code (P.S. I removed the if condition just to isolate the accuracy problem):

    function initialize() {
        View.initialize();
        enableLocation();
    }


    function onPosition(info) {
        counter = counter + 1;
        posInfo = info;
        accuracy = posInfo.accuracy;
        stats = System.getSystemStats();
        percentage = stats.battery.toNumber();
        //if GPS enabled check quality. If disabled disable location data.
            //If accuracy is good record data. If accuracy disable gps.
        // if (accuracy == Position.QUALITY_GOOD || accuracy == Position.QUALITY_USABLE){
        //     location = posInfo.position.toDegrees();
        // } else {
        //     disableLocation();
        // }


        WatchUi.requestUpdate();
    }

    function enableLocation() {
        gpsEnabled = true;
        if (Position has :hasConfigurationSupport) {
            if ((Position has :CONFIGURATION_GPS_GLONASS_GALILEO_BEIDOU_L1_L5) &&
            (Position.hasConfigurationSupport(Position.CONFIGURATION_GPS_GLONASS_GALILEO_BEIDOU_L1_L5))) {
                options[:configuration] = Position.CONFIGURATION_GPS_GLONASS_GALILEO_BEIDOU_L1_L5;
            } else if ((Position has :CONFIGURATION_GPS_GLONASS_GALILEO_BEIDOU_L1) &&
          (Position.hasConfigurationSupport(Position.CONFIGURATION_GPS_GLONASS_GALILEO_BEIDOU_L1))) {
                options[:configuration] = Position.CONFIGURATION_GPS_GLONASS_GALILEO_BEIDOU_L1;
            } else if ((Position has :CONFIGURATION_GPS) &&  
            (Position.hasConfigurationSupport(Position.CONFIGURATION_GPS))) {
                options[:configuration] = Position.CONFIGURATION_GPS;
            }
        } else if (Position has :CONSTELLATION_GLONASS) {
            // this can fail with InvalidValueException if combination is not supported by device
            options[:constellations] = [ Position.CONSTELLATION_GPS, Position.CONSTELLATION_GLONASS ];
        } 
        options[:acquisitionType] = Position.LOCATION_CONTINUOUS;

        //Starts the reciever, sends recieved info to onPosition
        Position.enableLocationEvents(options, method(:onPosition));
        // System.println("enableLocationEvents is called");

    }

  • As long as the GPS receiver is on, it draws power, even if you are in a stone basement and it can't see any GPS info at all  It's always looking for data..

  • Got it thank you. What is the cause behind the high accuracy despite the lack of reception tho?

  • How much time do you give it after you lose GPS?  Just tried a test with one of my apps that shows accuracy.  Sitting on my desk, GPS was good.  But then I put the watch in a metal box (blocking GPS data) and looked a minute or two later, and I shows the accuracy had dropped.  Then I saw the accuracy change from "lost", to "OK", then back to "good"

    There I'm getting the accuracy from Activirt.getActivityInfo().currentLocationAccuracy

    If I just want a single location (say to get the weather), I never use ONE_SHOT, but start it CONTINUOUS, and when I get a reasonable accuracy in the callback, I disable GPS, and that works fine too.

  • I tested it a couple more times but it's very inconsistent. Sometimes it immediately drops to 2 and sometimes it takes 10 minutes. But either way, whenever I go indoors, the counter stops. I even went to the supermarket and stayed there for 20 minutes but the accuracy never dropped from 4 even though no position info was received.

  • The callback won't be called unless there is GPS data, so you want to look in Activity.Info or you may want to try Position.Info.

  • So in that case, should I do the accuracy check outside the callback function? Can I see the code you made to get an idea of how to do it?

  • I made an application that disables location events when the accuracy is less than or equal to 2 to make it energy-effienct.

    I assume this is a device app, which means that disabling location events would turn off the GPS receiver.

    Is there a condition where you want to turn the GPS back on? Not to state the obvious but you won't be able to detect if and when better GPS accuracy is available if the GPS receiver is off.

    Also not to state the obvious, but if this is a running app (for example), there are perfectly reasonable cases where GPS accuracy might go from good to bad, like when the user runs under a bridge or tree cover. Most users would expect the app to recover when GPS conditions improve.

    Another obvious use case is when the user launches the app when they're indoors or GPS is otherwise unavailable.

  • Sounds like you are doing a watch-app/device-app.  Are you recording a fit file?  If so. look at Acitivity/getActivityInfo().currentLocationAccuracy when your onUpdate is called.

  • I plan to periodically (through a timer) enable the location events. My goal is to make an app that tracks my location for as long as possible, which would be not long if the GPS is enabled all the time.

  • I plan to periodically (through a timer) enable the location events.

    That's what I figured, although I still wonder if it's an optimal user experience. I'm guessing that the timer period would be fairly long (maybe 1 to 5 minutes) to achieve the power saving goal.

    If it's just for your own personal use anything goes tho.

    Do you own a watch that supports UltraTrac? I've never used it but it seems to fit your use case (from what you've said.)