getProperty() of boolean

Former Member
Former Member

I am just starting out with MonkeyC and I seem to have an issue with the getProperty function. This is the line of code in the View.mc file in a watch-face project:

System.println(Application.getApp().getProperty("UseMilitaryFormat"));

And this is the actual UseMilitaryFormat in the properties.xml file:

<property id="UseMilitaryFormat" type="boolean">false</property>

Since UseMilitaryFormat is set to false, I'd imagine that the console would print 'false', but instead it always keeps on printing 'true', regardless of what the property is set to. Any ideas why and what I can do to fix it?

  • An obvious first check is on your assumptions!

    The value is set as false in the XML, yes, but that is just the start point and can be changed via Settings Manager. 

    Equally, if you trial the app one way (causing the simulator to save current settings) and then modify the XML, the initial value is still saved and will be used until you either reset it or clear the app in the simulator. 

    Either way, the value you are seeing in .println should indeed reflect the actual property value at the time you run your code. 

  • It will also reflect a change if you changed it with the App Settings Wizard in Eclipse