Overriding resources with qualified resources folders

Hello,

I have an app for Fenix 5X Plus only. Now, on request from someone out there, I am trying to add support for Vivoactive 3.

When I build for Vivoactive, the build system complains that the launcher Icon shall be 40x33px (for Fenix 5X Plus it is 40x40px).

So I followed this guide
https://developer.garmin.com/connect-iq/programmers-guide/overriding-resources/
in order to provide alternative launcher icon for my two different build targets.

And I failed it make working :(

Here is my directory structure (attached picture).

The build system complains it cannot find the images/launcher_icon.png. Because it is not in the generic "resources" directory, only in those two target-specific resource directories (resources-fenix5xplus and resources-vivoactive3).

I also tried to have the PNG file also in the generic "resources" directory - different error but not helped.

It appears to me that the resources overriding does not work at all.

The jungle file contains this

project.manifest = manifest.xml


And the manifest is like this

<!-- This is a generated file. It is highly recommended that you DO NOT edit this file. --><iq:manifest xmlns:iq="www.garmin.com/.../connectiq" version="3">
<iq:application entry="KkClimbingApp" id="a3218e9f3acd4e36830c028a4e860a8f" launcherIcon="@Drawables.launcher_icon" minSdkVersion="3.0.0" name="@Strings.AppName" type="watch-app" version="0.0.3">
<iq:products>
<iq:product id="fenix5xplus"/>
<iq:product id="vivoactive3"/>
</iq:products>
<iq:permissions>
<iq:uses-permission id="Communications"/>
<iq:uses-permission id="Fit"/>
<iq:uses-permission id="FitContributor"/>
<iq:uses-permission id="Positioning"/>
<iq:uses-permission id="Sensor"/>
<iq:uses-permission id="UserProfile"/>
</iq:permissions>
<iq:languages>
<iq:language>ces</iq:language>
<iq:language>eng</iq:language>
</iq:languages>
<iq:barrels/>
</iq:application>
</iq:manifest>


I read a few threads on forums and the documentation, all false, no help. I also checked the samples in the SDK (there is NOT exactly this example but something similar, to me I did it all well).

Can anyone help me out of this frustration?

Thank You & Best Regards,

Jiri.
community.garmin.com/.../1444064.png
  • There is a section in the Programmer's Guide dedicated to Overriding Resources. It should help for cases like this.

    From a quick look, it does not seem that either of the resources-fenix5xplus or resources-vivoactive3 are overriding any resources because there are no XML files in either of those resource folders. If you created resources-fenix5xplus/resources.xml and resources-vivoactive3/resources.xml with the following, I'd bet it would work.

    <resources>
    <bitmap id="launcher_icon" filename="images/launcher_icon.png" />
    </resources>


    Travis

  • If launcher_icon is the only thing involved, I take a very simplistic approach. I size the icon so with will work with any target, On devices that allow one a bit larger, it gets padded for those devices. Based on app type and device, a user might not even see the icon, plus, if you decide to change it, you don't have to change multiple versions.