Can I write one widget with glance view for all watches

I plan to write simple widget, icon, progress (line) text - so it' can be maybe ciq 1.x app

If I implement getGlanceView(), will this widget run for all watches? If no glance system shows view?

By the way is any place to see what functionality are implemented on each watch? My widget will show stress but on my f6 there is widget with stress and if this widget is on all watches I don't want to spend time unproductive.

  • Unless you have a device with glances, there are things you don't see in the sim or like on the device.  For one, you see 3 different widgets at the same time

    Thanks I realize that. OP mentioned they have a device that supports glances, so that's covered, too. Plus it's already covered in the doc that's already been linked in this discussion.

    Just a "glance" with more details close at hand.

    Yeah I think we get that "glance views" are for "glances". Then again the difference between "summary" vs. "more details" is not the same as the difference between "data that's updated every second" vs. "data that's updated every 30 seconds."

    Your glance could display a single number, but maybe you still want that one number to be updated more frequently than twice a minute.

    maybe displaying seconds in a glance isn't that critical, as the user can just go full screen.
    I think even a reduced glance is better than the launcher icon and app name, which is what happens with no glance view.  Looks like something is missing in the app.

    If we're still talking about my stopwatch widget, I don't think it makes sense to show the stopwatch time unless it can be updated once per second, because then it looks like the stopwatch is broken if it's in the "running" state and the time isn't being updated. If I can't display the stopwatch timer, then the app name seems like the best choice.

    As far as the OP's widget goes, they said they need per-second updates. It's up to them whether they think 30s updates aren't acceptable for glance mode.

    OP mentioned that they want to implement a stress widget. The stress widget on my 935 updates in real time (more or less). So maybe they think that a stress widget which only updates every 30 seconds is lame.

  • I've finished my widget and waiting for approval :)

    I've done very simple solution, no jungle, no drawing if no live update. Simple:

    //glance view
    function onUpdate(dc)
        {
            var t = TIM.now().value();
            
            if((t - mT) < 30)//mT was iinitalised to 0
            {
                //live draw
            }else
            {
                //first draw and no live update
                //draw text "no live update. enter into widget
            }
            mT = TIM.now().value();
        }

  • Cool. That's pretty similar to my suggestion:

    Alternatively:
    - Your first onUpdate() could display the "non-live" view

    - All subsequent onUpdate() calls could display live data.

    That would avoid hardcoding "liveUpdate" capabilities in the jungle file, but it might not look great.

    I do think that checking whether it's been less than 30s since the last onUpdate() is unnecessary. According to the docs which I quoted above, for non-live glances, the entire app starts and stops every 30s. So you'll never see a 2nd onUpdate() for non-live glance devices. Every onUpdate() will always be the first one (since the app started) and mT will always be 0. (Assuming that the docs are correct). All you really need to do is to check whether there's been more than 1 onUpdate() since the app started.

    I still think that simply displaying the app name could be sufficient.

    Or if you really want to have instructions: "{APPNAME} (Press START)"

    But I think it should be well known that you press START (or tap on the screen) to see more information for a widget.

  • 1. I don't know how other devices run so text has to be "universal".

    2. You are wrong, it can be more than one onUpdate

    - start

    - update 1

    - wait 30s

    - press down

    - update 2

  • 1. I don't know how other devices run so text has to be "universal".

    I just mean that it's a lot of text and maybe you could just have the app name. The user probably doesn't care about what "live glance" means IMO. I just think that less is more in most cases.

    Most widgets, especially Garmin widgets, don't have any special instructions on what to do to see more information. (Some CIQ widgets do, but I think it's unnecessary)

    2. You are wrong, it can be more than one onUpdate

    My bad. I was just going by my understanding of what the docs say. Maybe I misunderstood the docs, or maybe the docs don't match reality, especially this line:

    During a background update, the Widget and its GlanceView will run through a complete life cycle.

    developer.garmin.com/.../

    Background UI Update

    Devices that have less memory [2] will start the app only when the system deems it appropriate, and calls to WatchUi.requestUpdate() will have no effect. Such a device could update the ‘Glance Page’ when it becomes visible (activated) and at least 30 seconds since last update.

    During a background update, the Widget and its GlanceView will run through a complete life cycle. The AppBase functions onStart(), getGlanceView() will be called to start the app and retrieve the view. Once the GlanceView has been retrieved, the View functions onLayout(), onShow(), onUpdate() and onHide() will be called. The AppBase function onStop() will be called, and the app will be shut down.

    All content that is rendered to the dc passed to View.onUpdate() will be cached on the filesystem and used to display until the next time the system decides to do an update.

  • 1. I prefer strict communication, if there is enough place I show all :)

    Maybe somebody read all so won't speak "don't run", less helpdesks:).

    2. Sorry but documentation isn't good/clear all the time doing tests (without debugger because doesn't run on my eclipce). I've discovered it by accident (I have THIS gift :)).

    3. the problem is starting app when it change glance view to view, so you have to save data if you want to show in view the same what was displayed in glance - I've resigned and start drawing from the beginning.

    after enter to full view

    after few seconds

    There is other problem, when widget is on the end ("hidden") there is no onUpdate, so when when user scrolls widgets and my shows even with live view there is flushing text an clearing, but ok, no jungle,  noto to remember about new devices.

  • 1. I prefer strict communication, if there is enough place I show all :)

    Maybe somebody read all so won't speak "don't run", less helpdesks:).

    Sure, it's up to you.

    But it could be as simple as:

    There are no touchscreen watches that support glances, but if you're worried about future watches, you could check DeviceSettings.isTouchscreen and display "Tap to enter" if the device has a touchscreen.

    I just find that the more text you write, the less likely people are to read it. (I see the irony.)

    And I think less text just looks nicer (if you can get away with it.)

    You also avoid displaying incorrect information ("Device doesn't support live glances") for one second on devices which actually support live glances.

    2. Sorry but documentation isn't good/clear all the time doing tests (without debugger because doesn't run on my eclipce). I've discovered it by accident (I have THIS gift :)).

    Yeah, the docs are often incomplete / misleading. I've found a lot of bugs, too.

    3. the problem is starting app when it change glance view to view, so you have to save data if you want to show in view the same what was displayed in glance - I've resigned and start drawing from the beginning.

    Why not save data to application storage? Seems like it would be a better UX.

    There is other problem, when widget is on the end ("hidden") there is no onUpdate, so when when user scrolls widgets and my shows even with live view there is flushing text an clearing, but ok, no jungle,  noto to remember about new devices.

    The first time you detect that the device supports live glances, you could save that information to Application storage, to avoid this problem. No need to hardcode live glance info in the jungle (although that's my preferred solution, personally.)

    Seems that the only problem could be that you might not detect live glances if the user only ever scrolls quickly past your widget, instead of stopping for 2 seconds.