Experienced developer, new to Garmin, looking for SOE

We had a fully features yacht racing app ready to go on a pebble (RIP) and want to migrate to Garmin Vivoactive HR.
No prior experience with the platform so big learning curve.
Biggest issue is understanding Garmin's "Standard Operating Environment" (SOE)
As our sailing app is deeply involved in tracks, courses and routes I am interested to discover the details of the facilities available to me as a developer to interact with these features.
For example,
  • is it possible to record the GPS values of SOG and COG in the GPX track file?
  • Can I persist other data that may be downloaded from our web site, such user ID, yacht name, yacht characteristics etc?
  • What are the characteristics of a "course" or "route"?
  • What facilities are there for a user to define a course?
  • Is there any documentation at a level between the very high level Programmers Guide and the API Docs which assumes a detailed understanding of Garmin SOE?

Need help!
  • I'd be careful not to jump to conclusion too quickly. There are numerous things that eat up memory very quickly if you aren't careful. And an app that quickly chews up most of it might just be being sloppy. Custom fonts can quickly eat up memory. As can lots of small objects. I've gotten in the habit of using array's of values instead of objects in many cases. An array of coordinates could chew up a ton of memory vs two arrays or an array where every other element is longitude vs latitude.
  • Please talk to me more.
    Since I don't have access to the FIT file, one thing I'll have to do is to store the track as an array of maybe 15,000 position records (4 hours, 1-second frequency) with time, lat, lon, sog, cog. And at the end of the race, transfer it to the phone to POST to my web site.
    That sounds like a big ask.
  • Yes, you can do some things that could help to reduce memory (and object) usage quite easily. For example, avoid multi-dimensional arrays. If you have a 100x2 array, that's actually 101 arrays - the array of 100 arrays of length 2. It's cheaper to use 2 single dimensional arrays

    var array1=new[100];
    var array2=new[100];

    and even a bit cheaper to use only 1 array
    var array=new[100*2] and use the 1st and 2nd half as your two dimensions.

    makeWebRequest() can also burn a bunch of memory based on the size of the response. The response is converted into a dictionary, and that process is memory intensive. Maybe you can cut down the response size and free up a bunch of memory there.

    90k for an app is quote big. My largest is about 75k - it's got 11 different data screens (including 4 graphs) and has the space to save the lat/lon every minute for 12 hours. (a single array with the lat in the bottom half, the lon in the top half)
  • 15000 position records isn't likely to happen here. Even a simple array, that's 15000 x 2 x 4bytes = ~120k. (not including your COG/SOG) So basically the entire memory space. You might be able to compress it as your lat/lon isn't changing much but that gets cumbersome. I'm wondering if the new Fenix will break out of the 122K memory limit like the Edge devices which go up to 1 MB on the Edge 1000 I believe.

    You don't have direct access to the FIT file on the device from within your app but you can access it when the user connects to the computer or get it from Garmin Connect. If you are willing to pay Garmin to be an official member (1 time fee I believe. not sure what they actually call that), your server software could directly/automatically grab the .FIT file from Garmin's servers. There is a .FIT sdk at https://www.thisisant.com/ (free) that will help you parse the .FIT file with examples in several languages including c# and C++.

    If you have BT contact with your phone during the event, you could always upload it on the fly so you aren't storing that much data on the device.

    Hope you weren't expecting this whole process to be too easy! :)
  • Thanks for the encouragement!
    I'll spend some more time fiddling around with the sample app and try to see where the memory has been consumed.
    I'm sure I'll have more Q's.
  • Please talk to me more.
    Since I don't have access to the FIT file, one thing I'll have to do is to store the track as an array of maybe 15,000 position records (4 hours, 1-second frequency) with time, lat, lon, sog, cog. And at the end of the race, transfer it to the phone to POST to my web site.
    That sounds like a big ask.


    Ok, if you record a .fit, there is an option for 1 second recording on the va-hr, which will save your lat/lon every second. I'm not sure what cog and sog are, but you can store those in the .fit as developer data at the same frequency as the lat/lon. When saved, the .fit can view viewed in GC, on a map for lat lon, and you can show the cog and sog in a graph. If you want to get that data on your website, you could build something that reads the .fit there and do whatever you want with the data (see the FIT SDK - https://www.thisisant.com/resources/fit)..

    So you may not need to save any of the 15000 position records in your app. In the app I mentioned with 12 hrs of lat lon, I save that so that on one of the data screens I can draw the route I've taken.
  • BTW - with your app with 11 screens, do you have them all loaded together, or is there a way of saving space by loading them separately, as required?
  • I have to agree with Jim. You can actually get a surprising amount of functionality in the limited memory. My 630 only realistically gets 52k of useable memory for an app that records a workout. And I've been able to implement a fully functioning running/hiking app with probably 10 data pages including a track drawing, and elevation graph, although each limited to about 200 data points.

    You just need to be a bit creative at times.

    Also as mentioned in other threads, a lot of memory can be taken up using the "layout" mechanism of CIQ. It can be much more memory efficient to do all the drawing yourself with dc.draw... Just gets a bit trickier to run on multiple devices with different screen shapes/sizes.
  • BTW - with your app with 11 screens, do you have them all loaded together, or is there a way of saving space by loading them separately, as required?


    I assume he does it like I do where he does all the drawing himself, so it is just code and all gets loaded at once. You can either do it with multiple view classes, or a single view class that keeps track of which page you are on. If you don't need a lot of unique user input handling on various pages, it's probably less memory intensive to use a single view and a switch statement in the update method to call the appropriate per page drawing method. I use a single view in my case.
  • BTW - with your app with 11 screens, do you have them all loaded together, or is there a way of saving space by loading them separately, as required?


    They are all loaded at onces. There is no way to load things as need in Connect IQ. If you build for different target, you can load different versions of things based on the device (I use the "exclude" logic in the resource overrides in the same app for things like displaying the magnetic compass, which isn't available on all devices.)

    With the 11 data screens, I also do them all in the same view, by just using a "page number" in onUpdate().

    I have a slimmed down version of this app that runs on 1.x devices (it was actually the initial version), and as EKUTTER said, you can squeeze quite a bit into that. My hiking app for the 630 is at about 52k right now, and has 8 data screens, and will only save 9 hrs of every-minute lat/lon to chart out the route.