Acknowledged

Marq series is using wrong widget memory limit in simulator

Hello Garmin team,

the Marq series is using the wrong memory limit for widgets in simulator.

The device reference is reporting: widget 1048576

https://developer.garmin.com/connect-iq/reference-guides/devices-reference/#marq%C2%AEathlete

But the simulator is showing: 28kB

Could you please check he device details and update the device details for the SDK manager?
With these settings, a test is not possible in simulator.
File/image upload seems not to be possible, so I could not add a screeshshot from the simulator.

Many thanks and regards

Ronny Winkler

  • Thanks, Jim. I did it now in a similar way.

    But any hints to find the reason for the runtime error? I'm thinking about reading some data with the Api if a bearer token is still valid. But then I will get this error again. But that's for the future. If you some hints what could couse this, please give me hint. Else you van close this thread as it is not an error. Many thanks again for your time.

  • Try moving  your new HomeyApi() from initialize in AppBase to getInitialView, or in initialize() in your main view

    initialize() in Appbase is called when either the glance or the main view starts.

  • Yes, that's clear. I got problems, because in app.initialize I instantiated a class where I have many API relevant implementations (oAuth, webRequest...). I'm not sure, but it seemes that causes an error. Perhaos in this class are some resources used without the glance annotation. Or all together need too much memory.

    Now I don't instantiate this class on startup. Instead it's done in the get function. This way I don't get the error on glance view because is only instantiated from the main view.

    Such dependencies can cause compiler errors like this:
    Error: Illegal Access (Out of Bounds)
    Details: Failed invoking <symbol>
    Stack:
      - initialize() at Y:\...\garmin.widget.homey.oAuth\source\HomeyApp.mc:32 0x10000026

    And at this line ther is the class:
        public function initialize() {
            AppBase.initialize();
            mHomeyApi = new HomeyApi();

    If I call mHomeyApi = new HomeyApi(); only in a getApi() function, all is riight. But I can't see what's the exact cause of this app crash. I don't read ressources, only properties. So perhaps it's just the memory used by the two classes - but the memory peak in simulator is only 11kB.. So it's still not clear. But I got it working now with the mentioned changes.

    If the error message would mention the correct code line which is not allowed in glance, it woul dbe much easier to fix it.

  • In your main view, isGlanceModeEnabled can be used to see if you were started by way of a glance or not

  • Two things.  Code used in a glance needs to have the (:glance) annotation.  Also, resources used in a glance need to be scoped for that:

    See "Resource Scopes" here: https://developer.garmin.com/connect-iq/core-topics/resources/#resources

    Not sure why you want a 2nd app.  If you are on a device with glances, you'll get the glance view and can then go full screen.  If the device doesn't have glances, it will go right to full screen.  I have widgets that run on devices from the original vivoactive to current ones.