How are the apps handled / run when sideloaded to the watch.

Hi,

I am not sure the title explains it that well, I cannot find this sort of information in any of the guides / examples etc I have looked at.

I am new to writing apps etc and I am playing around with VSC and the simulator, it is a bit of a steep learning curve from the programming (industrial automation) I did at work but I am getting somewhere. Soon I hope to be trying to download it to the actual watch (Vivoactive 4).

With the existing apps, I select one (walk for example) and when I have select it, it then says wait for GPS and then ready and so on. When I have finished I press the top button and it comes up with a square box and 2 options, delete or save etc.

So the question I have is, does the operating system handle all of this or have I got to take care of it somehow in my app?

Regards,

Bob

  • With the existing apps, I select one (walk for example) and when I have select it, it then says wait for GPS and then ready and so on. When I have finished I press the top button and it comes up with a square box and 2 options, delete or save etc.

    So the question I have is, does the operating system handle all of this or have I got to take care of it somehow in my app?

    You have to handle the UI part yourself. CIQ has an ActivityRecording API, but it doesn't provide the kind of standard UI that you'd see in a native activity.

    So if you wanted to mimic native activities, you would have to reinvent the wheel by:

    - Assigning the START button to start/pause/resume an activity recording

    - Implementing a pause menu to allow the user to save or discard the recording when paused

    - Implementing multiple data pages (if necessary) with scrolling via the UP/DOWN buttons (or touchscreen swipes)

    - Taking a lap in the recording when the user presses BACK/LAP (or swipes right on the touchscreen, for watches like Vivoactive 3 which use that gesture to take a lap in native activities), and calculating the corresponding lap metrics (assuming you display them)

    - etc.

    However, the good news is that the ActivityInfo class gives you access to processed activity data (like time, distance, speed, heart rate, etc.) which is very similar to what you'd see in a native activity. The bad news is that you have to calculate lap values yourself, as well as converting things from native units to human-readable units (e.g. speed is available in metres per second, but if you want to display pace in km or miles per minute, you'd have to do that calculation yourself)

    These links may help:

    https://developer.garmin.com/connect-iq/core-topics/activity-recording/

    https://github.com/garmin/connectiq-apps/tree/master/device-apps/namaste

  • Having said all of that, if your main interest is augmenting an existing native activity (like Run) with additional data, your best bet might be to implement a data field. A CIQ data field can display and record additional data for an existing native activity, and you don't have to reinvent the wheel as far as activity recording/UI/etc goes, since the native activity takes care of all of that.