A coupla questions on goals and alerts...

So I have an app that manages an exercise session and stores the session at the end along with fit data.

But...

When users get alerts or hit their step goals, then they are sometimes kicked out of the app as the alert shows and then have to restart from the beginning when they return. This, obviously, is not ideal!

So I'm looking in the simulator and the docs.

I'm guessing I will need to override "getGoalView" to do some clean up such as either serialising the current session to resume later or blocking the goal altogether.

Two problems;

1. That is a guess!

2. I cannot find a way to simulate the goal kicking in order to find out whether I'm even slightly correct!

Any clues?

Thanks,

  • The getGoalView function should only get called for watchface apps.

    I’d need to check some documentation that I don’t have access to right now, but I think the goal animations should not run while an watch-app is running.

  • That makes sense, so I wonder if I am misunderstanding the bug report. (The email was from a German whose English is way better than my German, but still needed a bit of thought.)

    I wonder if a standard notification overlay (like a WhatsApp or whatever) came in and they clicked back button to clear it? If so, I can process the back response a bit more sensitively. But is there any way to simulate that on the simulator, or do I need to get my wife to send me WhatsApp on demand?

  • You're likely just seeing the firmware's goal message (or notification message), and in a device app, you really shouldn't have to do anything special. I never have, and have had no issue, including when I access the music player, widget loop. etc.

    If you're doing something special in onShow()/onHide() that maybe be involved, and you can trigger those in the  sim under the settings menu.

    If you get kicked out of your app, it could also be your app is crashing, so check garmin/apps/logs/ciq_log.xml

  • Oh! Yes, I do one or two things in onshow / onhide that might sometimes be better in onstart / onstop. Nothing major, but certainly stuff that has the potential to get in the way.

    (I've checked ERA and no logs generated for this, user didn't mention any issues either, just restarting where he wanted to resume.)

    you can trigger those in the  sim under the settings menu

    AH! Never seen those options before... Flushed

  • Depending on your app, you may find some things are better done in onLayout() or based on an input delegate.

    For example, in mine, the "start" button is used to start recording, and if pressed again, I pause the recording and display a resume/save/discard menu.

    And in onBack, if I'm recording, I do an addLap() and return true, while if not recording return false, and the app exits.