Is there a way in Monkey C how to write device-dependent variants of code that are compiled different at compile time?

Hi all,

I wonder if it's possible to implement variants of code in Monkey C that are selected at compile time for a specific device? I know I can do it in runtime (https://forums.garmin.com/developer/connect-iq/f/discussion/971/is-there-way-to-detect-watch-model?service=https:%2f%2fforums.garmin.com%2fdeveloper%2fconnect-iq%2ff%2fdiscussion%2f971%2fis-there-way-to-detect-watch-model) - but I that does not help if some devices are, for instance, getting out of memory. I would like to have reduced functionality available on devices with smaller memory and better functionality on devices with bigger memory, without having to maintain separate apps for that. Doable?

Thx,
Petr

  • Yes. You can use jungle file and excludeAnnotations or even add different files/directories to the sourcePath. I do this. Devices with only 16kB memory have a subset of features. 

  • I also use Jungle for the case where a device has on-board maps vs those that don't.  There I use different mc files if using on-board maps or draw a breadcrumb trail:

    srcBase=source;..\SenHisMisc;..\ClockSun
    resBase=resources
    
    #maps Stuff
    base.sourcePath=$(srcBase);source-nomaps
    base.resourcePath=$(resBase)
    
    # tested with maps
    fenix5x.sourcePath = $(srcBase);source-maps
    fenix5x.resourcePath = $(resBase);resources-maps
    
    fenix5plus.sourcePath= $(srcBase);source-maps
    fenix5plus.resourcePath = $(resBase);resources-maps
    
    (two lines for each device with on-board maps)