3.1.3 using BufferedBitmap (with the full palette for Anti Aliasing)

Moving to this new SDK has all of my existing watch faces no longer working, and running out of memory when using BufferedBitmap.  The faces were working before with the F5 and F5+ series, but these are also erroring out now too.  Initially, I figured it was an issue with the F6X since the resolution is now 280x280 vs. 240x240 and the size of the watch face background buffer may be larger than acceptable.  If I limit the palette to 16 colours and turn off font antialiasing, it works fine. 

I even tried to comment out code to reduce the memory used to a point where the  there should be enough memory for the bitmap, but this still isn't working.

Is there a new method for building an analog face with antialiased fonts?  

  • As far as a new method, that might be something yet to be discovered.  With the f6s, it's 240x240, so your existing stuff should work, but with the f6 and va4 at 260x260, and the f6x at 280x280, things can get tight as they all have the same amount of memory for watch faces.  But the va4s (218x218) should be no problem, as it's got 92kb like the others.

  • That's what I would have thought, but simple using the new SDK, even the previously working faces aren't working anymore.

  • Same issue here too.  I hope garmin are able to "release" some more memory to connect IQ apps in the new Fenix6 and vivoactive4 devices through a firmware update...  Otherwise, will have to either make the watch face smaller (ie, 240 pixels), not use anti-alias fonts, or not support these devices.  Crazy.

  • When you view memory diagnostics how much memory is the buffered bitmap object taking up?

  • For me, it fails trying to create the buffered bitmap.  As per attached image.  Interesting that the onPartialUpdate() function still runs even though watch face crashed...  You can see the error and triggering line of code in this image:

  • To answer your question specifically - I had to create a new vanilla project and add this code:

            offscreenBuffer = new Graphics.BufferedBitmap({

                :width=>width,

                :height=>height

            });

    This creates a buffer with a size of 67696 on a Fenix6 Pro (260 pixels) vs. 57696 on a Fenix5+ (240 pixels).  That's quite a difference, as you would expect with the increase in screen real-estate.

  • I think everyone is failing to read the following line in the original post:

    The faces were working before with the F5 and F5+ series, but these are also erroring out now too. 

    I don't believe I'd expect the memory consumed to have increased for these devices. This issue should be investigated.

  • I'm not as savvy as many of the developers here, so I simply went to the devices.xml file and updated the watch face memory by adding a 100KB to it just to get the old face to actually run and see what the memory consumption was.

    It's almost 100KB whereas on the previous SDK they were coming in around ~85-89KB.  This is with no change to the code I wrote.

    I can't seem to switch back to using an older SDK either - not sure if it's the additional resource-280x280 folders or what, but the following error comes up: 

    I can't set a Run Configuration on an older SDK.

  • Just for reference this is the above procedure with the 6X Pro.  I don't know how it would be possible to do an antialiased watch face if the background  buffer is going to eat through 80% of the RAM.  And here I was gearing up to try to use font based hands for antialiasing as well - I guess that's on hold for a while longer, or even a non-starter.

    Anyhow, any help or insight would be greatly appreciated.

  • My limited understanding is with the new resolutions you will have to split up your resources even more, but the bigger batteries should allow you to do more resource loading and still have decent battery life.