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
  • 1. There is change during the game....

    I write app for 3.2.4 everything run well - there is only one limitation power budget. Suddenly I'm informed about penalty, but it isn't mean that to power budged is added loadResource but it is forbidden to use such function! Should I rewrite app? How to write good code in this situation?:

    a) if(!lowpower) loadResorce? - loadResource is only service not the point it's impossible to write anything this way

    b) if(!lowpower) functionWihout_loadResorce else  functionWith_tloadResorce - duplicate code, memory limitation, bad coding...

    ...

    2. It's impossible to call loadResorce during low power but I can cal requestUpdate - strange

    3. So going to low power it's nothing important for me, according to doc:

    The device is entering low power mode.

    Terminate any active timers and prepare for once-per-minute updates.

    from this point I only know that:

    - no timer

    - onPartialUpdate will be called every second

    - onUpdate will be called every minute

    - onSettingsChanged may be called by system/user

    - onTemporalEvent/onBackgroundData may be raised

    and I prepared for all this situation, but the problem is with onUpdate because it's called during low power and If i call loadResource it raised error but only on fenix 5 probably.

    I can't load all resource to memory because I have only 92kb!!! And for example when I have fonts for night and day I load it during onUpdate.

    I've made a test and put in onUpdate and onPartialUpdate loadResource(Rez.Strings.TST), no error on

    - sim (sdk 3.2.5 and 4.0.1)

    - my fenix 6 (sdk 4.0.1) 

    so I think there is a problem on fenix 5

Comment
  • 1. There is change during the game....

    I write app for 3.2.4 everything run well - there is only one limitation power budget. Suddenly I'm informed about penalty, but it isn't mean that to power budged is added loadResource but it is forbidden to use such function! Should I rewrite app? How to write good code in this situation?:

    a) if(!lowpower) loadResorce? - loadResource is only service not the point it's impossible to write anything this way

    b) if(!lowpower) functionWihout_loadResorce else  functionWith_tloadResorce - duplicate code, memory limitation, bad coding...

    ...

    2. It's impossible to call loadResorce during low power but I can cal requestUpdate - strange

    3. So going to low power it's nothing important for me, according to doc:

    The device is entering low power mode.

    Terminate any active timers and prepare for once-per-minute updates.

    from this point I only know that:

    - no timer

    - onPartialUpdate will be called every second

    - onUpdate will be called every minute

    - onSettingsChanged may be called by system/user

    - onTemporalEvent/onBackgroundData may be raised

    and I prepared for all this situation, but the problem is with onUpdate because it's called during low power and If i call loadResource it raised error but only on fenix 5 probably.

    I can't load all resource to memory because I have only 92kb!!! And for example when I have fonts for night and day I load it during onUpdate.

    I've made a test and put in onUpdate and onPartialUpdate loadResource(Rez.Strings.TST), no error on

    - sim (sdk 3.2.5 and 4.0.1)

    - my fenix 6 (sdk 4.0.1) 

    so I think there is a problem on fenix 5

Children
No Data