Complete

fenix 5 Plus: 14.00 bad serve onEnterSleep

I have strange error on f5plus, stack

-onEnterSleep, ok

-draw, ok

- updC from draw but this function is called only when no low power (I check it) - it means from onUpdate so probably every minutes update or after BT connection 

- onBD, ok calling from updC

error Invalid Value in onBD  in line loadResource

I know, from 3.2.5 I can't use loadResource during low power but why system call onUpdate during low power then raise error when I use loadResource?

Parents Comment Children
  • 1 Yes, I can do everything but give me more memory!!!!  Not 1Mb, 20Kb, ok?

    2. Which memory? background? app? global? view. What about saving memory if I have a few web requests? I saved 1,5kB memory removing it from property and save it in storage and now you suggest me again consume it.

    3. Don't you see  that something is not logical? What is informed about low power? View! So how can you limit  app from something what is known from view? yes, yes, i can have members with view isLowPower, or save this members in app.isLowPower but you have to write it in docs that is normal flow to add this (maybe you add this  to  app wizzarad).

    So if you want to limit something add it to power budget and raise onPower...

    You tell to write entire screen during onUpdate, allow to call requestUpdate in onPartialUpdata and others but you prefer limit useful functionality.

    Application that do NOTHING, consumes about 7% per hours and you limit watch face which consumes 1%? Correct first app/widget.

    And soon  most will show ... only time....

    My wf (it's rather complicated, not only time(run up to 6 days without charging and I test a lot) so it's possible to write energy efficient  wf. But I'm not going to fight with such sdk because it is impossible to write good software if the sdk is not good.

  • app onBackgroundData Storage.setValue and becouse app is in low power I can't use this

    instead of setValue (access app storage), can you save the data in memory and wait for onUpdate to process it? there is no budget limit associated with onUpdate, and it will still be called once per minute.

  • 1. flow

    - app BAG.registerForTemporalEvent

    - low power

    - bag onTemporalEvent somewhen, call makeWebRequest(... callbackFunc)

    - bag callbackFunc BAG.exit(data)

    - app onBackgroundData Storage.setValue and becouse app is in low power I can't use this

    so probability to read data equal almost 0

    simple loadResource, in view, so it's WatchUi.loadResource() (but both exist fenix has 3.1 sdk) and it's call only during onUpdate (also when is low power - every minutes onUpdate). I've added check for this situation but I have another place when I have to load name of day and month after changing midnight. Solution is simple load it onSettingsChange but it consumes memory, a lot of memory 19 strings...

  • I don't understand your question. If you are trying to forward data from the background app, there are two methods available to do this.

    1. Grab the existing contents of background data (with a call to Background.getBackgroundData()) and then update it as needed and 'send' it to the foreground (with a call to Background.exit(result)). The foreground app will get the data in a call to AppBase.onBackgroundData() which you can consume and process as needed.
    2. On devices that have ConnectIQ 3.2 support, the background data can be written directly to Storage via Storage.setValue() and then read back in the foreground app via Storage.getValue().

    The code snippet here shows you accessing Rez.Strings values via loadResource() (presumably this is a call to Application.loadResource() or WatchUi.loadResource()?). Is this code being called from a background or glance context? If so, do the string resources have the appropriate annotations so they are accessible in those contexts?