Problem with redraw watchface after o'clock chime rings, or connection lost message

Hi. i building  watchface with many data fields. For energy efficient i use partial refresh only for fields with changed data.
When  o'clock chime rings, or connection lost message, this message draw directly on canvas. And i cannot program  determinate end and start this message to do full refresh screen only one time, for energy savings. Coz one refresh up to 0.5 sec of processor time. 

Any possibility  to determinate end or start  of this message ? i try all methods all fails ( 



  • The received wisdom is that onUpdate should always be a full update and onPartialUpdate is where you only do partial updates.

    However, that doesn't mean you need to calculate and draw continually.

    If things that don't change often are drawn onto BufferedBitmap only when they are updated, and onUpdate simply draws BufferedBitmap onto the canvas, for example, that will cut down on a lot of calculation during onUpdate.

    The tl;dr is "be a bit clever about how you do your updates, but do a full update".

  • I know about BufferedBitmap ,not enough memory for buffer all the screen have only 10kb free memory

  • I feel your pain.

    That said, remember two things that will save memory:

    1. BB doesn't need to be the whole screen, it can just be a tiny part of it

    2. BB can have a much reduced palette - if you only need two colours, a 2 colour palette will save 8 times the memory of a 16 colour palette...

    Etc. 

  • The only way to deal with this is to update the full screen when onUpdate() is called.  You may want to look ate how you calculate things and in some cases just display the data vs calculating it.  An example would be sunrise/sunset where that only changes once a day and there's no reason to calculate it every time onUpdate() is called.

    You can look at other ways to optimize your code.  An example here is avoid calling Application.Properties.getValue each onUpdate.  Read the values at start up and in onSettingsChanged and cache their values.  If you are using a layout, look at direct dc calls instead. and when it comes to screen positions, don't calculate them every time onUpdate is called, but calculate them in onLayout and the just use those values in onUpdate().

    Probably the best way to optimize is to reduce what you display.  If you display 25 things, maybe cut back to 20

  • It well optimized, all info cashed in memory,  only draw graph use high load cpu, and i haven't memory to cash them. All memory that's:  code, about 3000 lines, 6 fonts, and cashed strings, arrays, 1 glyph

    after watch motion  "onUpdate" fires about 10 - 15 times, every time i need full render the screen, coz i don't know what the  update type. onExitSleep() onEnterSleep() - not useful , coz motion can be on   " o'clock chime rings" "connection lost" "low  phone charge "  to (

    Srry for bad English) 

  • Can the creators of SDK make function to determinate when something draw on the screen ? Or better when disappear.  
    I met many watchfaces with this bug (


  • The lower level CIQ might not even know, as this is something done in the firmware.  Always update the whole screen to avoid this.  

    Even if this changed today I doubt it would be back ported to older devices.

  • I don't now the  structure of firmware, but i think CIQ know when something fire on the screen. 
    All for energy savings. Garmin watch -  it is energy efficient, and want make maximum efficient app, as possible. 
    Now full refresh on onUpdate() took about 200-360 msec, and refresh only partial data which have changes - 35msec - 60msec
    On simple "watch motion"  full redraw drain battery in x5 time more 

  • What's what happens when you do a really complex watch face.  How are you measuring the x5 and 200-360ms?  In the sim or in the watch?

    Understand the vast majority of the time onUpdate() is only called every minute.

  • onUpdate() - calls every second for 12 sec , when  watch is motion . It is hundred times per day, when even walking. 
    refresh time measured on the watch, in the simulator - its always -  zero

    how i measured:

    onUpdate() 

    var startTime = System.getTimer();

    do all draws, and checks ..

    ..

    ..
    var elaspedMilliseconds = System.getTimer() - startTime;

    lrSunrise.draw(elaspedMilliseconds ,dc); //tmp

    elaspedMilliseconds  ~40msec - on "smart" redraw, ~300msec on full redraw