Same app on different devices with different API versions

Is it possible to have the same app to run on for example an Epix 2 (API level 4.1) and Fenix 3 HR (API level 1.4)? I'm using Eclipse but the different settings I try don't seem to work for all targets at the same time: SDK version is either too low or too high depending on target. If I'm not doing anything wrong (happy for advice!) - is there a good workaround to get it working? Or what is the solution to have one app running on all Garmin watches.

  • I have a number of apps that run on CIQ 1 devices to those with CIQ 4/System 5.  You just need to pay attention in your code.  I use "has" a fair amount, but there's also jungles.

  • In other words, you set the minimum API level (minApiLevel in manifest.xml) to be the lowest one that works for all the devices you care about. If you use "1.2.0" then you'll support all CIQ devices. "1.3.0" will support all CIQ devices except the original Epix. I mention 1.2.0 vs 1.3.0 because the only device difference is Epix, but there are some significant language differences, like the lack of a Char type in 1.2.0, so it may not be worth doing the extra work just to support Epix.

    Then you handle device-specific differences (not limited to API levels) either:

    - at compile time, using build exclusions via jungle definitions and source code annotations 

    and/or

    - at runtime, using has and/or various Monkey C API calls to check for device-specific differences, when applicable.

    Build exclusions have the advantage of saving as much memory as possible on code, which is useful if you develop data fields for old devices that only have 16 KB for data fields, or old to newish devices that only have 32 KB for data fields. The disadvantage here is that the jungle definitions can get pretty unwieldy once you start excluding things based on multiple "dimensions" (such as CIQ API level, screen resolution, screen size, font families, etc.) There's also the counter-intuitive nature of defining what a given device (or set of devices) does *not* have (via excludes). e.g. If I have annotations w, x, y, z that apply to 4 versions of a given function foo(), and I want to say that the epix2 device should use w, I can't express that directly -- I have to instead say that epix2 should *exclude* x, y, and z.

    Runtime methods like has have the advantage of being much simpler to maintain, but at the cost of increasing code size and memory usage.

  • Thanks, good information. Will try to implement this. Need to step up my skills a notch..!

  • if developing to include older watches, with different [lesser] API levels and screens sizes, do they all have to be in the same upload or can they be uploaded incrementally as long as they use the same UUID? It seems the answer is no.

    In other words, the code, builds and uploads for already published watches does not have to be modified, with risk of unexpected results, and any number of older watches can be added and maintained independently?