Confusion about SDK version in CIQ 2.1.3

Ok, so I figured out how to use build file resources so I only need one version of my app. That was cool.

BUT, the release notes for 2.1.3 sayAdd ability to target specific SDK version when building for a device.

We already have that ability at the project level. What does it mean for the build to target a version? For instance I see this in the build command line:
-s 1.2.1
Why would I want to target that version? What does it even mean? Does it mean I can't use 1.2.6 features like HR zones?

Is there a way to disable this?
  • I see the -s flag is not used when creating a package. Why is it useful?
  • I see the -s flag is not used when creating a package. Why is it useful?

    It is used when building the .prg for each device. That way you can have a binary for one device that expects 1.2.x, and for another device that expects 2.0.x all in the same app entry in the app store.
  • It is used when building the .prg for each device. That way you can have a binary for one device that expects 1.2.x, and for another device that expects 2.0.x all in the same app entry in the app store.


    The package builder in Eclipse doesn't use the -s flag. It only seems to be used by the run configuration. It's not clear to me why it's useful, or what it does.

    Even if the package builder used the -s flag, why would you want to?
  • I think it would be very useful if a developer could assign different PRG files to the packager which are then digitally signed. This would make it possible that I have memory-optimized implementations for different watch types which I then include in one single IQ-File.

    I urgently need such a feature. Having this only for PRG files and not for IQ files is pointless because this I can also reach by splitting up my projects.
  • I think it would be very useful if a developer could assign different PRG files to the packager which are then digitally signed. This would make it possible that I have memory-optimized implementations for different watch types which I then include in one single IQ-File.

    I urgently need such a feature. Having this only for PRG files and not for IQ files is pointless because this I can also reach by splitting up my projects.


    You can do this. Look here at the very end under build file exclusions:
    https://developer.garmin.com/connect-iq/programmers-guide/resource-compiler/

    My SmartCycle app actually is two apps packaged as one. One is for devices with only 16kb of memory, the other for devices with more memory. I did this by excluding a .mc file for the memory challenged devices.
  • Thank you very much for this hint. It works for all watch types except for the vivoactive_hr.

    Though I have exactly the same directory structure and the same source file names, it does not run as he cannot find a vivoactive_hr specific class.

    Any ideas on that?
  • Sorry I didn't create a specific resource file for the vivoactive_hr so I don't know.
  • Thank you very much for this hint. It works for all watch types except for the vivoactive_hr.

    Though I have exactly the same directory structure and the same source file names, it does not run as he cannot find a vivoactive_hr specific class.

    Any ideas on that?


    Device specific resources are for things like strings, bitmaps, and layouts. There's no way right now to do devices specific code (classes) or a device based conditional compile. You need to include everything in the build and then decide which to use at runtime. Either that, or do a "roll your own .iq". Petr (Actiface) did a thread about how he does it with his watch faces a while back and you can check that out.
  • Jim, you can do device builds. This was added with Biker Monkey I believe. Here's an example:

    resources\resources-fenix3\build.xml:
    <build>
    <exclude file="..\..\source\unwantedFenix3Code.mc"/>
    </build>


    You can also do code annotation and directory based excludes:
    <build>
    <exclude dir="..\..\source-excluded" />
    <exclude annotation="roundImpl"/>
    </build>


    See https://developer.garmin.com/connect-iq/programmers-guide/resource-compiler/
  • I didn't notice that change.... Interesting...

    Ok, I put together a really simple app, where I had different code for a va-hr,230, and 235. This is cool! I don't know how I missed this. Thanks for pointing it out.

    One think to note, is you'll still have to use "has" (or check monkeyVersion) at times in device specific code. For example, with the 230 code, that's for all 230-like devices. The non-APAC 230 have a 1.3.x VM, but the APAC 230 (230J) is still 1.2.x