wf limitation app battery consuming

Why wf limitation was made?

As only one CIQ app can run in time and app can have over 1000kB why Garmin limit wf to about 100kB (not for all devices)?

Why there is limitation for access to some  SDK features (e.g. attention)?

I've written simple app which makes ... nothing  and after few tests I can see that it consumes about 5 times more energy than wf so it means that app can run about 1 day. So its' impossible write app like alarm or observer.

So to solve problems with energy and functionality the best solution is to

- allow wf to do the same thing like app

- allow app to choose low power mode, off screen etc

But maybe I don't know how to write such application. Simple, I want to write app which can do exactly the same what my wf do. Is any way to do it and both app and wf will consume the same energy?

  • .  With attention, you might say it's minimal for an hourly chime, but a WF could do chimes every 5 minutes.

    Noone would install a wf that does a buzz every 5 minutes.

    I know we 've had the discussion before but i still think the connect iq team has made the wrong decision by not allowing the attention module from within a watch face... so many interesting use cases that would bring!

  • yes, false - system decides, true app served system do nothing

    so when I return false system simple kill app

  • but a WF could do chimes every 5 minutes.

    by background process I understand, so I have to decide what to in onTemporalEvent, reading data or playing song...

    can background call exitTo?

  • No Attention in background services.  You also can't do an exitTo from a background service.

  • .  With attention, you might say it's minimal for an hourly chime, but a WF could do chimes every 5 minutes.

    so how wf can do chimes every 5 minutes? is sound or vibrate? flashing display is not enough to wake up user Slight smile (or meybe if I start flashing fas watch starts vibrate from it hahaha)

    Yes, a widget can have a background service, just like a watch face.  But background services have limitations as watch faces do. (you can't record an activity for example)

    if widget is not visible, can it play alarm, do vibrating, tell system to show it? for example I start timer in widget.

  • o how wf can do chimes every 5 minutes? is sound or vibrate?

    You can't in a watch face as Attention isn't available.  But if Attention was available you could.

    f widget is not visible, can it play alarm, do vibrating, tell system to show it?

    See Background.requestApplicationWake()

  • You can't in a watch face as Attention isn't available.  But if Attention was available you could.

    if app is in foreground i don't to have to make such tricks, because I can do alarm in many ways (timer for example).

    See Background.requestApplicationWake()

    I've done it, not satisfied, one short vibration and ask if open app, not wake up user. And the other problem that background can be kill by system.

    if widget is not visible, can it play alarm, do vibrating, tell system to show it? for example I start timer in widget.

    maybe this, I don't want to do next test Slight smile

    Now I'm preparing app to measure battery usage by app.

  • I'd like to put some code and

    is next forum error, test it

  • so, I'm not bloked

    let's try again, no code in code format...  so clear text

    using Toybox.WatchUi            as UII;
    using Toybox.Timer                 as TMR;
    using Toybox.Time.Gregorian     as GRE;
    using Toybox.Time                 as TIM;
    using Toybox.Graphics             as GRA;
    using Toybox.Math                 as MAT;
    using Toybox.System             as SYS;

    class batteryusageView extends UII.View
    {
        var mDrawNumTMR, mDrawNumTOT = 0 , mTMR, mIsMeasuring = false, mMeasureStartTIM, mMeasureStartBAT;
        
        function initialize()
        {
            View.initialize();
            mTMR = new TMR.Timer();
        }

        function getCurrentData()
        {
            return [MAT.floor(SYS.getSystemStats().battery), new TIM.Moment(TIM.now().value())];
        }
        
        function onMeasureTMR()
        {
            mDrawNumTMR++;
            requestUpdate();
        }

        function onSelect()
        {
            if(mIsMeasuring)
            {
                mIsMeasuring = false;
                mTMR.stop();
                onMeasureTMR();
            }else
            {
                mIsMeasuring = true;
                var c= getCurrentData();
                mMeasureStartBAT = c[0];
                mMeasureStartTIM = c[1];
                mDrawNumTMR = 0;
                
                mTMR.start(
                    method(:onMeasureTMR),
                    1000*60,
                    true);
                onMeasureTMR();
            }
            return true;
        }
        
        function onUpdate(dc)
        {
            dc.setColor(GRA.COLOR_TRANSPARENT, GRA.COLOR_BLACK);
            dc.clear();
        
            var f = GRA.FONT_SYSTEM_TINY;
            var t;
            
            var c= getCurrentData();
            
            if(mMeasureStartTIM)
            {
                dc.setColor(GRA.COLOR_BLUE, GRA.COLOR_TRANSPARENT);
            
                dc.drawText(130,90, f, "mDrawNumTMR=" + mDrawNumTMR, GRA.TEXT_JUSTIFY_VCENTER + GRA.TEXT_JUSTIFY_CENTER);
                
                var m = (c[1].value() - mMeasureStartTIM.value())/60;
                var T = (m / 60).format("%02d") + ":" + (m % 60).format("%02d");
                t = GRE.info(mMeasureStartTIM, TIM.FORMAT_SHORT);
                t = t.year + "-" + t.month.format("%02d") + "-" + t.day.format("%02d") + " " +
                    t.hour.format("%02d") + ":" + t.min.format("%02d") + ":" + t.sec.format("%02d") + " " + T;
                dc.drawText(130, 110, f, t, GRA.TEXT_JUSTIFY_VCENTER + GRA.TEXT_JUSTIFY_CENTER);
                
                t = c[0] - mMeasureStartBAT;
                
                m = m ? ((c[0] - mMeasureStartBAT)/m.toFloat()).format("%.2f") : 0;
                
                dc.drawText(130, 130, f, "BatSta=" + mMeasureStartBAT.format("%.0f") + "% " + m + "%/min", GRA.TEXT_JUSTIFY_VCENTER + GRA.TEXT_JUSTIFY_CENTER);
            }
            
            mDrawNumTOT++;
            dc.setColor(GRA.COLOR_YELLOW, GRA.COLOR_TRANSPARENT);
            
            dc.drawText(130,190, f, "mDrawNumTOT=" + mDrawNumTOT, GRA.TEXT_JUSTIFY_VCENTER + GRA.TEXT_JUSTIFY_CENTER);
            
            t = GRE.info(c[1], TIM.FORMAT_SHORT);
            t = t.year + "-" + t.month.format("%02d") + "-" + t.day.format("%02d") + " " +
                t.hour.format("%02d") + ":" + t.min.format("%02d") + ":" + t.sec.format("%02d");
            dc.drawText(130, 210, f, t, GRA.TEXT_JUSTIFY_VCENTER + GRA.TEXT_JUSTIFY_CENTER);
            
            dc.drawText(130, 230, f, "BatCur=" + c[0].format("%.0f") + "%", GRA.TEXT_JUSTIFY_VCENTER + GRA.TEXT_JUSTIFY_CENTER);
            return true;
        }

    }

    this simple code on fenix pro 6

    results:

    mDrawNumTMR=77

    ...01:16

    BatSta=23% -0.07%

    mDrawNumTOT=80

    ...

    BatCur=18%

    0.07*60=4.2%/h

    4.2*8h = 33.6%/night not acceptable...

    wf: 0.014%/min -> 0.83%/h

    and I think watch is warm Slight smile

  • Is it normal such consumption battery?

    I have very easy idea which allow developer to write fine app - remove question about wake up app, this call only app belong to background process, or if Garmin afraid something:

    - add to ciq new requestApplicationWakeWithoutQuestion

    - add new permission "Allow wake up app"