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

Parents
  • Only a comment... I didn't define a glance view and awaited to get this blank screen with app name. But i got a "out of bounds" error.
    I think it was because I'm using Communications.registerForOAuthMessages(method(:onOAuthMessage)); or something that is not supported.

    I can't say what exactly. I have this call in a separate API class that was instantiated in app.initialize(). I think that caused the error. Or the app and the API class was too much for the glance memory.
    So the compiler should show some details what exactly is missing there.
    And it's not really clear, what is instantiated for glance view. The app itself I think. And all the app instantiates.

    Is it perhaps possible to define a second app version oinly for glance view (without all this API stuff)? Like this:

    class HomeyApp extends Application.AppBase {
    // do nothing
    }

    (:glance)
    class HomeyApp extends Application.AppBase {
    // API stuff

    Or a Appbase function to check if I'm inside a glance view?

Comment
  • Only a comment... I didn't define a glance view and awaited to get this blank screen with app name. But i got a "out of bounds" error.
    I think it was because I'm using Communications.registerForOAuthMessages(method(:onOAuthMessage)); or something that is not supported.

    I can't say what exactly. I have this call in a separate API class that was instantiated in app.initialize(). I think that caused the error. Or the app and the API class was too much for the glance memory.
    So the compiler should show some details what exactly is missing there.
    And it's not really clear, what is instantiated for glance view. The app itself I think. And all the app instantiates.

    Is it perhaps possible to define a second app version oinly for glance view (without all this API stuff)? Like this:

    class HomeyApp extends Application.AppBase {
    // do nothing
    }

    (:glance)
    class HomeyApp extends Application.AppBase {
    // API stuff

    Or a Appbase function to check if I'm inside a glance view?

Children
  • 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.