Acknowledged
CIQQA-3060

AppBase.getGlanceView() docs claim if null is returned, "the app name will be used as preview content"; in sim: no glance view is provided at all; on real CIQ 4+ devices, glance shows launcher icon and nothing else (no app name)

For context:

CIQ 2 (and lower devices) such as FR935 only supported full-screen widgets and not glances.

CIQ 3 devices such FR945:

- still have a distinct "widget" app type (both in manifest.xml and in compilation output)

- allow widgets to run in either (full-screen) "widget" or "glance" mode (controlled by user setting)

- if the user runs a widget in glance mode but the app does not override AppBase.getGlanceView(), a default glance will be provided consisting of the launcher icon and app name. This was very convenient for devs who wished to port an old widget from CIQ 2 to CIQ 3 devices, as it meant little or no code changes had to be made to achieve equivalent functionality

CIQ 4 devices such as FR955:

- no longer have distinct "widget" app type. When building an app with "widget" in the manifest, the output type is actually "watch-app" (device app)

- device apps can have a glance view, but only if getGlanceView is explicitly overriden

This is why it's interesting that the docs suggest another way to get the default glance view is to return null from getGlanceView(). For CIQ 4+ devices, there would seemingly be no other way to accomplish this (except to recreate the default glance view in code.)

However, it doesn't seem to work at all.

- In the sim, for both CIQ 3 and CIQ 4+ devices, if getGlanceView() returns null, the behaviour is the same as if getGlanceView() was not overriden at all. In the case of the sim, for both CIQ 3 and CIQ 4+, the app just runs in "normal mode" (with no glance)

- On a real CIQ 3 device (fr945lte), if getGlanceView() returns null, the default glance view is indeed provided. This is great, but it was already possible by simply omitting getGlanceView.

- On a real CIQ 4+ device (fr955), if getGlanceView() returns null, a "default glance view" is provided, but it's only the launcher icon, and not the app name. This is a shame because it would really be nice to have the equivalent "default glance view" functionality in CIQ 4+ devices, so that if you're porting a widget/glance from CIQ 2/3 to CIQ 4, all you have to is provide a simple implementation of getGlanceView that return null.

Indeed, there have been a few user complaints about popular old widgets that were ported to new devices, but lack a glance, because the dev didn't realize they had to explicitly override getGlanceView(), starting with CIQ 4.

(I would argue that the CIQ compiler should automatically add a default glance view implementation to apps with a type of "widget", when building for CIQ 4+).

  • If getGlanceView() is overridden and returns non-null, for an app with a type of "widget", the behaviour for both CIQ 3 and CIQ 4+ devices is correct on both the sim and real device, except for the bugs mentioned here:

    forums.garmin.com/.../bug-report-with-connect-iq-sdk-8-1-0-widget-builds-for-instinct-2-like-devices-are-no-longer-launched-in-glance-mode-in-simulator

  • - In the sim, for both CIQ 3 and CIQ 4+ devices, if getGlanceView() returns null, the behaviour is the same as if getGlanceView() was not overriden at all. In the case of the sim, for both CIQ 3 and CIQ 4+, the app just runs in "normal mode" (with no glance)

    Actually this isn't 100% true. It's true for CIQ 4+ devices, but not CIQ 3 devices.

    I tested in SDK 7.4.3 since 8.1 other bugs regarding Glance Launch Mode (https://forums.garmin.com/developer/connect-iq/i/bug-reports/bug-report-with-connect-iq-sdk-8-1-0-widget-builds-for-instinct-2-like-devices-are-no-longer-launched-in-glance-mode-in-simulator?CommentId=4945cf98-8684-4a1f-9237-854c9b8a0f3d), but the following behaviour is also seen in 8.1, apart from those bugs.

    There are roughly 3 sim bugs and 1 device bug here.

    In the sim, with a widget built for fr945 (CIQ 3):

    - if getGlanceView() is not overridden, then the app behaves like a device app (with no glance). If you press UP or DOWN, the app does *not* terminate.

    [sim bug 1] The bug here is that a CIQ 3 widget is acting like a device app, as if it was built for a CIQ 4+ device, even though CIQ 3 widgets *do not* act like device apps on a real device.

    On a real device, a CIQ 3 widget either acts like an old full-screen widget (no glance, pressing UP or DOWN at the initial view terminates the app aka scrolls away from the widget), or it launches in glance mode.

    - if getGlanceView() returns null, then the app behaves like an old full-screen widget: if you press UP or DOWN, the app terminates (as a real widget would). In the sim, the Glance Launch Mode setting is available, but changing it does nothing.

    [sim bug 2] The bug here is that in the sim, the app never launches in glance mode; on a real device configured for glance mode, the app would display the default glance view (launcher icon and app name), as documented.

    --

    In the sim, a widget built for fr955 (CIQ 5) is of course actually built with a type of a watch-app (device app):

    - if getGlanceView() is not overriden, then the app is literally a device app with no glance, and acts accordingly. No bug here

    - if getGlanceView() returns null, then the app still acts like a device app with no glance. The bugs here: [device bug 1] on a real device, a broken default glance view would be shown with no launcher icon, although the docs explicitly say that the app name would be used for preview content. [sim bug 3] the sim should also show a glance (with default glance view)