Any fix for makeImageRequest on CIQ 4+ devices?

I have a function that calls makeImageRequest in the background, and updates the watch face with the image when it is received. This works perfectly in the sim for a "Captain Marvel" watch so I know that the code can and does work, but I get this on the Fenix 7x sim:

When using SDK 7:

Error: Exception occurred
Details: failed inside handle_image_callback
Exception: Class usage is not allowed for the current app type.

It seems to me that because calls to makeWebRequest work on every device I've tested and makeImageRequest works on some devices that this error message about class usage is a red herring.

With SDK 6 I get this instead:

Error: Out Of Memory Error
Details: failed inside handle_image_callback
Stack:

Is there any hope that this will be fixed?

  • For a Fenix 7x CIQ 5, in the memory dialog the bitmaps loaded from Rez shows like this:

    And this:

    Notice that while the images are different sizes, the watchface memory usage is the same.

    Here's the face buffer:

    The graphics pool only shows the combined value of the three, not their individual sizes:

    A few things: If a 9 pixel image can't be loaded because of memory constraints , then there is no point in proceeding because no useful image can be loaded. Please provide a screenshot of the graphics pool memory usage for one of your watchfaces which shows the individual items in the pool and the memory they are using that you loaded using makeImageRequest, and how I can display the individual items in the graphics pool so I can reproduce it on my system.

  • I don't know what have you shown... The size of bitmap is 280x280, not

    1. Use device without graphic pool you will see simple var

    2.

    class ...

    {

    var mLoadedBMP = {};

    function onReceiveImage(code, data)

    {

    if(code == 200 && data != null)

    {

    mLoadedBMP[28]= data; //! I use dictionary so my memory viewer looks like above
         }
       }
    }
  • I don't know what have you shown... The size of bitmap is 280x280,

    Really? That's a buffer for the display, for partial updates for analog watch faces.

    What's the code in #2 for? If what I have works for CIQ 3 devices then obviously I have working code. The issue is in CIQ 4/5 Communications.makeImageRequest crashes before the callback is called.

  • It can be problem with memory in graphic pool. As I have mentioned, system try to put graphic resource only in graphic pool so when you fill it others resources and don't allow to free or resource is too big - error.

    I still want to know how big is downloading bitmap, maybe it is resized to whole screen?

  • It might be this: https://forums.garmin.com/developer/connect-iq/f/discussion/281365/makeimagerequest-fails-in-background-of-watchface-on-4-0-device which didn't turn up on my initial search but how shows up in the "Related" sidebar.

    If so it would be nice if Garmin could document it, because it sure doesn't say "Watchfaces in CIQ 4+ can't get images from the internet anymore, all your watchfaces are borked" anywhere explicitly that I have found. Garmin "improved" CIQ 4+ devices by allowing only compiled in images is the only thing that makes sense. I tried to do it in the foreground and got a permissions error so that can't work either.

  • 2 years without fixing the bug...

    It was met me many times. You read doc, try to implement something and spend hours to fixing not yours bugs (often impossible to fixing).

  • I tweaked my watchface to be an app and moved the image code from the background, and it works perfectly. At least I know it wasn't a coding problem, it was a "Garmin forbids it to work" problem once again.