How do I know if onStop,onStart is suspend/resume or start/stop in my datafield?

In my DF i need to be able to differentiate between starting "from scratch" (then the DF needs to connect to the nearest ANT HR device using ANT ID: 0) and when I am "saving for later" and then "resuming" the activity (then the DF needs to connect to the same ANT ID it was connected before resuming, so instead of 0 I need to use the actual ANT ID).

I thought that in both onStop and onStart I will know if the scenario is "full start / full stop" by having state as null, and the "suspend / resume" by having something else in state. But unfortunately it seems I haven't understand the documentation because in both cases state is null.

Now my problem is that because I can't differentiate between the two onStop-s, currently even if I finished the activity I save the ANT ID, which causes the next onStart (even if it's a totally new activity) load the ANT ID, and instead of connecting the nearest ANT device it only wants to connect to the same device I used last time.

Is there a way (or trick) to differentiate?

  • You mean adding a glance view to your device app and having it work on CIQ 3 devices?  Try it, but I would expect it would work just fine.  Like having a glance view in something and running it on a device that doesn't support glances.

    No. If you read what I said carefully, I am specifically asking about adding support for CIQ 4 devices for an existing app codebase that exists as both a device app and a widget on the store.

    Again, previously I assumed that it was impossible to add CIQ 4 support to a widget type app on the store, since as you said, CIQ 4 devices don't really support CIQ widgets anymore.

    So, I assumed that the correct way to implement a CIQ glance for CIQ 4 for an existing app is, as we both said, to add a glance view to the existing device app on the store.

    However, previously in the thread you said a bunch of stuff about how if you build a widget for a CIQ 4, it becomes a device app. Again, I am curious what this means for existing widgets in the store.

    So my actual question is: If I have an existing widget in the store, can I add CIQ 4 device support to it? Previously I would've assumed the answer is "no", but now I'm not sure based on the other stuff you said.

    The reason I'm asking is because if I already have a device app and a widget version of the same codebase in the store, it's easier to just add CIQ 4 device support to both of them, as opposed to also adding the glance view to the device app version (and worrying about running out of memory on older devices which can't use the glance view and don't need it - then I have to worry about removing that code for older devices using jungles/conditional compilation.)

  • Back with the in-person summits everybody went home with one of the newest devices.  Since those days, I use my paypal donations to keep current (and still have a few cold drinks!).

    CIQ 4 devices came out a couple years back (the venu2), and if you don't want to get one for app testing, you may want to be a bit careful with just adding CIQ 4 devices to your apps.  There's things like super apps, changes to buffered bit maps, the graphics and graphics pool, etc.  

  • When I added CIQ 4 support to my widget type apps (that had glances), it was little more than adding the CIQ 4 target.  The difference between widget type apps and super apps is all handled by the SDK.

  • When I added CIQ 4 support to my widget type apps (that had glances), it was little more than adding the CIQ 4 target.  The difference between widget type apps and super apps is all handled by the SDK.

    Thanks! So it sounds like there's even less impact on the end user than I thought, if a dev can update their existing widget app in the store to work with CIQ 4 devices.

  • Back with the in-person summits everybody went home with one of the newest devices.  Since those days, I use my paypal donations to keep current (and still have a few cold drinks!).

    It still costs money to travel to the summits. People have offered to send donations, but I doubt I'd make enough with my niche userbase to buy a CIQ 4 device. Plus I'd rather not accept donations tbh.

    Besides that, it's just the principle of the thing to me. Even if someone could afford to buy every generation of Garmin device, they shouldn't have to, especially just for hobby development.

    I know runners who are still rocking a Forerunner 235 (some of them are pretty fast - in the 2:30 to 3:00 marathon range - so they're dedicated runners). The FR 235 was released 7 years ago, which is an eternity as far as tech goes.

    Normal Garmin users don't seem to upgrade their watch every two years; it's not like the upgrade cycle for phones.

  • Yes there are a number of users that still have older generation devices, but people new to Garmin are using the new stuff.  Many of the "contact developer" messages I get are CIQ 4 devices , often with an AMOLED display, etc.

    From what I've seen in the platform forums, there are some people that updates their Garmin devices like some people update their phones

    It's up to you if you don't want the current gen of devices to test on, but it does help.  

  • From what I've seen in the platform forums, there are some people that updates their Garmin devices like some people update their phones

    Yeah probably the people who buy the top-of-the-line expensive stuff like Fenix. I think people who buy a midrange watch like 235 or 245 are less likely to update all the time.

    I update my watch a lot more often than most of the runners I know (every 2-4 years).

    And most runners I know don't care about CIQ, if they even know it exists. A lot of new casual runners prefer Apple Watch, and some "serious" runners are looking at COROS. Although I do know someone who went from Fenix to Coros to 955.

    I will say I've had a few requests to update my apps for newer devices. Mostly Fenix / Epix users, I think.

    It's up to you if you don't want the current gen of devices to test on, but it does help.  

    Sure, I just don't know if it's reasonable to expect devs in general, especially hobbyists, to be able to buy every new generation of Garmin. Even within generations there are differences, as discussed in the forums.

  • I think a lot depends on how many apps you have and their type.  If it's just data fields, probably not a big deal.  If you do watch faces, you may want device with MIP and AMOLED, as well as the new metrics in CIQ (Stress, body battery, etc).

    "widgets" and device apps may also have some features you wont see except on the newest gen devices.

    Getting a new device also means you get some of the newest device stuff (outside of CIQ), but CIQ can help to justify a new device! Smile

    I've had other hobbies that are more expensive than a new watch every year.  Things depend on what fits your budget.  While I don't charge a dime for any of my apps, a few people sending me a small donation, and that does help.

    Knowing a friendly dev that has a device you don't also helps.  That was another benefit of the in-person summits.  You got to know a bunch of other devs so it was much more than the "take home" device as the social side was very valuable!

  • My radar widget makes use of the download image method, so when I added support for CIQ 4 devices I had to make some small adjustments for graphics pool vs direct download.  Those adjustments were pretty minor and could be sorted out with the simulator.  After that it was no issue to add a CIQ 4 device to the widget.  As Jim noted, a widget app type automatically gets converted to a super app if you have added the glance view.  

    I have since released a full app version of my widget with a glance view and now use that to support all the new CIQ4+ devices.  The app version gives me access to more memory, but not widget views, on older devices and can fully support the features of all the new devices including glance views.  The only problem is the Edge 1040 does not seem to play nicely yet with Glance view/widget views.

  • I develop blindly (having only f6) but with a lot of help from ERA :)