Updating <properties> between Versions

Hi All,

I am wondering about good examples of storing versioning.

I took a default approach with <properties> but when the app updates, the "appVersion" remains at the first-installed version.

I assume this is 'good' property behaviour to ensure that user-overridden properties are not defaulted back to originals on app updates.

However, that doesn't help me!  I can obviously hard-code some global and pass/read that ... but the properties seemed simple. Searching the forums (why do so many search results seem to come up as 4-7 years old?) for "appVersion" shows this is an unresolved query but maybe there is a new answer in 2025?

Many thanks

<properties>
    <property id="appVersion" type="string">v1.6.1</property>
  • Can I ask what you are trying to achieve with version number? Do you need it at all?

    I use it for issues i.e. the version number is shown in the settings menu to the user so I can ask the user what version they are on (without relying on the Garmin version number), but I am starting to move away from this as I get virtually no value from it for the effort.

    Added: And this had more value to me when there used to be a version number in the manifest file - long gone now

  • Good question… I pass it as a param to a getWebRequest to help me understand the origin of other parameters in the query which are evolving as versions update (as well as a menu2 footer in the on-device settings). I’ll leave the <property> as an indicator of the history/first version installed and just remember to update in 2 places.

  • I found the same problem with storing in <properties> so ended up just hardcoding it

  • My method is

    Each time I update my I set the xml file with new version

    1) in a xml file

    <resources>
    <string id="VERSION">V=9.0.0  A=63414</string>  
        <properties>
            <property id="SERIAL" type="string">V=9.0.0  A=63414</property>
        </properties>
       
     
    </resources>
    in my code in initialize function
    SetProperty("SERIAL",WatchUi.loadResource(RezStrings.VERSION) );        
    For  old user with version 8.0.0 for example,  when they start the application, I update the property with 9.0.0
    For new user they have 9.0.0 and I update to 9.0.0
    In this case, you must start the application to update the settings. If you use garmin express, the settings is not updated.
     
    (:CIQ2HighMemory) function SetProperty(key as PropertyKeyType, value as PropertyValueType) as Void {
     
        try {
            Application.Properties.setValue(key,value);  
            // System.println("function SetProperty( dans le try key="+key);
            }
     
        catch(e) {
                                       //System.println(" quoi="+quoi+ " key="+key+" erreur="+e.getErrorMessage()  );
                                       Application.getApp().setProperty(key,value);    
                                      System.println("function SetProperty( dans le catch key="+key);
        }
     
    }