property value changes are not reflected after rebuild

Hi, i'm trying to do some versioning of my app, but changing the value in the sources will not show up in the simulator.

<resources>
<strings>
<string id="AppName">Test</string>
<string id="AppVersionTitle">AppVersion</string>
</strings>

<properties>
<property id="AppVersion" type="string">"1.0a"</property>
</properties>

<settings>
<setting propertyKey="@Properties.AppVersion" title="@Strings.AppVersionTitle">
<settingConfig type="alphaNumeric" readonly="true" />
</setting>
</settings>
</resources>


class TestView extends Ui.View {

function initialize() {
var appvers;
appvers = App.getApp().getProperty("AppVersion");
Sys.println("AppVersion: " + appvers);
View.initialize();
}


But this Code still retruns an old value:

Connecting to device...
Device Version 0.1.0
Device id 1 name "A garmin device"
Shell Version 0.1.0
AppVersion: "1.0"


Any ideas?
  • If you're doing this in the sim, and if the old version had the same key, and the .set file for that version in in the sim's temp directory, you'll get the old value.

    Delete the app's .set file, and it will get the new string.

    However, I don't think that will do what you want, as for users, they will have an old .set on their watch too, and will get the string from the old version.

    In your code to use the version number in app settings, what you want really want to do in the app is a setProperty() such as:

    App.getApp().setProperty("AppVersion", "1.0a");

    That will set the property to be what you want, and it will show in settings with GCM or GE, however, it won't be set until your app is run once. (unless the user didn't have a .set file, and then it will be what you defined for the property: <property id="AppVersion" type="string">"1.0a"</property>)

    So, to get "1.0a" to always show, it means that the user must uninstall the previous version (that also deletes it's .set), and re-install. But that also means the user loses all their old settings.

    What might be easier is to NOT use properties at all for the version info, but just find a place to display the app's version number on one of the apps screens. The user can just look at the watch to see what version they have, and it will always show the version they are using.

    What I do is in the main .mc file I have: (for example)

    var version="1.0a";

    And in many case display it - Usually with "AppName" (I don't in watch faces, as I don't want to use the screen real estate). When I change some code, I'll change the version, and when built, the version is reflected.
  • Thanks for your clear explanation, i found the temp .set file for the simulator.
    I just use the version string to be logged to the logfile.
    So simply using a string resource will do it.

    Just another question, how will one do some kind of version control in eclipse?

    PS: the AppVersion is used in the samples so this is misleading.
  • Just another question, how will one do some kind of version control in eclipse?


    Not that I know of...

    What I do, is just copy the project and paste it with a version number. So if I have "Myapp" that's version 1.0, and I want to start working on version 2.0, I'll copy "Myapp", and paste it as "Myapp-1.0" (and then close "Myapp-1.0" in eclipse so I don't open the wrong files by mistake!) so I'll then have two project: Myapp and Myapp-1.0, with Myapp-1.0 being the version of the code I uploaded to the app store, and Myapp being my current development project.