Is it possible to make an app support multiple app types?

In theory, can a single app be a watchface, widget, and datafield?  I mean, assuming it can live with the RAM size and API constraints for the different modes, is it possible for one app to tell the system it supports these different modes and to have the system retrieve the right kind of initial view in each case?

This seems like it would be desirable for an app with settings and state it could then share between these different UI modes.

I have seen some CIQ apps that seem to act as a glance widget,  and device app on my FR255.  I.e. they are installed once and can be in the glance loop, show more detail when selected, and also show up as an app in the activities list. Is this having multiple app types?  Or is this just the way Garmin presents a widget type of app on my device?

From examples I've seen, the different types seem to start with Application.AppBase.getInitialView() but there doesn't seem to be a parameter which could tell it which view type to create. Then there are variations like getSettingsView() and getServiceDelegate() that are for specific purposes.

It seems unfortunate that there isn't getWatchfaceView(), getDatafieldView(), getGlanceView(), etc. or conversely a single getView() with a parameter to tell it which view it wants.

Top Replies

All Replies

  • You can't - the app type is specified in the application manifest at build time.

    Besides, the various app types have very different capabilities, use cases, and memory limits (data fields are severely constrained compared to device apps.)

    The closest 2 kinds of apps are device apps and widgets, which is why they've been merged into super apps for newer devices (see below.)

    I have seen some CIQ apps that seem to act as a glance widget,  and device app on my FR255.  I.e. they are installed once and can be in the glance loop, show more detail when selected, and also show up as an app in the activities list. Is this having multiple app types?  Or is this just the way Garmin presents a widget type of app on my device?

    This is the one exception. Modern Garmin devices (CIQ 4+) technically don't support widgets anymore, they support "super apps", which are a combination of device app and widget.

    For these devices, when you build an app that has a type of "widget" in manifest.xml, the actual type that gets compiled in the IQ file's manifest is "device app". (You can see this by exporting a widget for both old and devices, such as fr245 and fr255, and extracting the IQ file with an app that open ZIP files.)

    On these newer devices, all device/super apps are available in the activity/app launcher by default. Additionally, if the app provides a glance view, it's also available in the glance list. Note that this precludes building a true "widget-only" CIQ app that's only available in the glance list. (Which is interesting to me, as there's plenty of native glances on newer devices which are not available in activity/app launcher.) Note that with older (non super app) devices, all widgets automatically provide a default glance view if the app doesn't provide one (assuming the device supports glances in the first place). Not so with newer (super app) devices - the CIQ app must explicitly provide a glance view for the app to be available as a glance.

    Anyway, what this means is that if you a build a CIQ widget app for both old and new devices, it will be a true widget for the old devices, and a device app / super app for the new devices.

    Related feature request:

    [https://forums.garmin.com/developer/connect-iq/i/bug-reports/feature-request-allow-ciq-4-0-super-apps-to-exist-only-as-glances-and-not-icons-in-the-activity-app-launcher]

  • This seems like it would be desirable for an app with settings and state it could then share between these different UI modes.

    Developers have asked for a way to share data (e.g. settings) between apps for a long time, but Garmin nixed the idea due to security concerns.

    [https://forums.garmin.com/developer/connect-iq/i/bug-reports/allow-shared-storage-between-apps]

  •  , does it mean, that on Edge 1040 (CIQ 5) you cannot reach any downloaded CIQ widget via „widget screen“?
    You always have to go via „Apps“ to open a widget?

  •  , does it mean, that on Edge 1040 (CIQ 5) you cannot reach any downloaded CIQ widget via „widget screen“?
    You always have to go via „Apps“ to open a widget?

    Good question.

    Tbh I only know for sure that what I said applies to watches.

    I don’t know much about Edge devices, but I looked at the manual for Edge 1040 and I see that it has a separate glance loop and widget loop, unlike CIQ 4+ watches which only have the one glance loop. The Edge 1040 manual talks about how Data Fields, Widgets and Apps are available from CIQ. OTOH, the Forerunner 965 manual says that Watch Faces, Data Fields, Apps and Music Providers are available from CIQ (no mention of widgets).

    So what I can infer from this is that super apps are only for watches, and not Edges (or other handheld devices.)

    EDIT: On the other hand, in the CIQ device library, edge1040/compiler.json no longer lists "widget" under the appTypes key, but it does list "glance". (Note: in this context, “glance” isn’t a separate app from the POV of the store / end-user, it’s just referring to the glance view of a device app / widget, which typically has less available memory than the full app. Also, older devices which don’t support super apps but do support glances will have both “widget” and “glance” under appTypes.)

    So it's entirely possible that Edge 1040 actually does not support widgets anymore.

  • BTW, here’s an archived copy of the CIQ super apps documentation (linked in the CIQ 4 announcement). I don’t know why Garmin has removed this page from their official documentation (and they haven’t made any direct mention of super apps in the current docs).

    https://web.archive.org/web/20211205173349/https://developer.garmin.com/connect-iq/core-topics/the-application-object/

    Super Apps

    Since API level 4.0.0

    In devices with API level 4.0 and above, the widget and device app types are merging. This means that widgets will now be launchable from the app launcher, and apps can have glances. The glance list is accessible to the user while they are in an activity, and your apps can be launched from the glance list while the user is recording an activity.

    Your existing widgets will still be able to build and run for API level 4.0 products without modification. However, you now must create a glance if you want the widget to show in the glance list. If you are building an app, creating a glance for your application gives users two unique ways to launch your app.

    Launching a Super App

    Apps will behave differently when they are launched from the glance list versus the activity menu. If an app is launched from the glance list, a timeout will be applied to the app. If the user does not exit the app within a given time frame, the system will terminate the app and return to the home screen. If an app is launched from the activity menu, however, it will not time out, and the user must explicitly exit your application.

    It doesn’t say anything about Edges being different, but that could be an oversight. I mean, the fact that the Edge 1040 manual still lists widgets as a separate app type from (device) apps, while the 965 manual does not, says something to me.

    If you want to be sure, build a widget app for Edge 1040, open the IQ file and look at the manifest information for that device. If the app type is still “widget”, then it’s not a super app (and Edge 1040 still treats device apps and widgets separately, as implied by the manual.) If the app type has been changed to “device app” then Edge 1040 does use super apps.

    EDIT: As noted in the edit to my previous comment, edge1040/compiler.json’s appTypes list contains “glance” but not “widget”, which means it almost certainly uses super apps the same as CIQ 4+ watches.

  • So it's entirely possible that Edge 1040 actually does not support widgets anymore.

    There‘s a widget on the IQ store for weather:
    https://apps.garmin.com/apps/c1facb1f-db5a-4352-adf3-9dd09e6fc668

    It cannot be started from the widget screen anymore. One has to find it under apps, what makes it useless for having a glance during an activity.

    Thanks for your comments,  !

  • Try this one.  I'm not sure if the one you tried has a glance view.

    You can skip getting an API key to just try it.

    https://apps.garmin.com/apps/6a740b9d-7bba-4ed8-bedd-2cabaef4bdcf?tid=1

  • There‘s a widget on the IQ store for weather:
    https://apps.garmin.com/apps/c1facb1f-db5a-4352-adf3-9dd09e6fc668

    It cannot be started from the widget screen anymore. One has to find it under apps, what makes it useless for having a glance during an activity.

    Yeah the dev needs to explicitly add a glance view for CIQ 4+ devices for the app to be available as a glance. I looked at that app and saw a review from 2023 which coincidentally complained that it’s not available as a widget or glance on Edge 1040 haha.

    This isn’t the first widget where users have complained that it’s not available as a glance on newer devices. It’s too bad that the super app change effectively changes all old widget apps into regular apps unless the dev adds code to implement a glance view, because it means that some of those old apps will probably never be available as a glance on newer devices (since that’s additional work the dev may not be willing to do)

  • The glance view is kind of what triggers it to be a "super app".  Things like a device app that records an activity, you may not want in the glance loop, and by not having a glance view, that's the case.

  • The glance view is kind of what triggers it to be a "super app".  Things like a device app that records an activity, you may not want in the glance loop, and by not having a glance view, that's the case.

    Thank you I understand that very well, although I disagree with your implication that a device app is not a super app unless it has a glance view. Just from reading the documentation I pasted above, clearly Garmin intends "super app" to refer to the merging of the device app and widget app types, regardless of whether an app has a glance view or not. This should be abundantly clear from the fact that legacy widget apps which lack a glance view are described under the "super app" section, despite the fact that they won't be available from the glance loop. However, I know what you meant.

    I'm suggesting that there's a different way legacy widget apps could've been handled for CIQ 4+, other than the actual implementation where a widget app is simply compiled as a device app for CIQ 4+. The way it is handled causes older widget apps to lose their default glance view (if one was not provided in the code), when they're ported to newer devices, and some app developers clearly aren't updating their old apps to provide a glance view to handle this issue. My point is that this is not the first time I've seen someone complain that a legacy widget app doesn't appear as a glance on a newer device.

    For example, an app which has a type of widget could be compiled for CIQ 4+ devices so that default glance view code is automatically generated by the compiler (with the same effect as the default glance view that was provided for older devices which support glances but not super apps). The default glance view code could take the form of either the actual code for displaying the default glance view, or perhaps some boilerplate code (like code which returns a special value that tells the firmware to display the default glance view.) Of course if this were implemented today (it won't be), the former approach would be better since it would require no changes to the device firmware.

    I get it, Garmin wants devs to explicitly provide a glance view if they want their app to appear in the glance loop. Well, clearly some devs aren't, even though their app is clearly meant to be widget/glance (simply from the fact that it was originally published as a widget.).

    Is it really so hard to say "Garmin may not have made the best decision in hindsight"? I'm not even asking for anything to be changed, simply making an observation. This isn't the first design/implementation decision that devs have disagreed with. Should we just never criticize anything?

    At the very least, if an app with type "widget" is compiled for CIQ 4+ devices and it lacks a glance view, the compiler could emit a warning. This would be a much simpler and less potentially objectionable change than what I outlined above.

    I don't expect that to happen either.

    Things like a device app that records an activity, you may not want in the glance loop, and by not having a glance view, that's the case.

    I made the opposite point a long time ago (and above) that devs may want to create an app which appears in the glance loop but never the activity/app launcher, but Garmin doesn't allow that use case anymore (for CIQ 4+ devices), even though it's possible for native glances. Interestingly, you don't seem to think that's a valid concern (iirc at the time you said the user doesn't have to add the app to the launcher if they don't want to see it there, or if it's already there they can remove it). Almost as if your default stance is to support the status quo and whatever design / implementation decisions have led to it.