Problem with Edit Object Store functionality in simulator?

I'm using the "Edit Object Store" functionality in the simulator to check various changes. However, when I click "OK" my widget restarts but the values remain the same. This is making it hard for me to debug. Furthermore, if I change the value in the properties.xml file and re-run the app the original value is still used. The only way I seem to be able to get the value to update is to use the "App Settings Editor" and send a new configuration to the simulator, which makes sense for "settings" but not necessarily for properties not assigned to settings per se. Am I missing something?

Furthermore, I'm unsure how the widget will react if I change one of these properties in the future.

For reference, I'm using SDK 1.2.11 on a Mac (with latest Eclipse).

Thanks,
Douglas
  • Former Member
    Former Member over 9 years ago
    - deleted -
  • With the 2.1.x SDK your are now seeing the difference between the Objstr and properties..... You can edit the runtime ObjStr in the sim, and the properties/settings in app settings in eclipse..

    They are different things, but in 1.2.x SDK's a bit confusing in the sim/eclipse environment..... There is no bug with this in 2.1.x. It's actually FIXING a bug!
  • Former Member
    Former Member over 9 years ago
    - deleted -
  • User (app) settings are done by the "App Settings Editor" in Eclipse. What to you see when you start the App Settings Editor while your app is running? If you don't see anything, do you define the <settings> for your properties in the resources?

    That actually reflects how things work from the store. There is a .json file (it's in the project's bin directory, and is included in the .iq when you upload) that defines the app settings. Eclipse uses the one in bin with the App Settings Editor. When you do app settings from GCM or GE, it gets that .json from the app store. (That's why you can't use app settings with sideloads)

    I admit, I don't use the Object Store editor in the sim much, as that's the stuff my apps generates and changes, and the changes that occur are due to running the app. I might look at the OS if I'm making sure what I expect in the OS is in the OS, but that's it... Recall, the OS in the sim is only actually saved for the next run when you exit the app (either your app has a way to exit, or you ctrl-k it in the Sim)
  • Also, to clear you ObjStr, you just need to delete the .str file for your app from the sim's temp directory. You can reset the app settings by deleting the .set file the same way.

    (both get deleted when you change SDK versions IIRC)

    When you run your app with those files deleted, the .str won't be written until you exit the app (like on a real watch). the .set file gets created when you start the run, and contains the default for your properties. So your defaults will show up in the app settings editor in eclipse.
  • Former Member
    Former Member over 9 years ago
    User (app) settings are done by the "App Settings Editor" in Eclipse. What to you see when you start the App Settings Editor while your app is running? If you don't see anything, do you define the <settings> for your properties in the resources?

    That actually reflects how things work from the store. There is a .json file (it's in the project's bin directory, and is included in the .iq when you upload) that defines the app settings. Eclipse uses the one in bin with the App Settings Editor. When you do app settings from GCM or GE, it gets that .json from the app store. (That's why you can't use app settings with sideloads)

    I admit, I don't use the Object Store editor in the sim much, as that's the stuff my apps generates and changes, and the changes that occur are due to running the app. I might look at the OS if I'm making sure what I expect in the OS is in the OS, but that's it... Recall, the OS in the sim is only actually saved for the next run when you exit the app (either your app has a way to exit, or you ctrl-k it in the Sim)


    Yes .. app settings are loaded when I go there in my app. But .. I can make a change and nothing ever happens.

    I keep getting just the default .. 0. Nothing ever changes.
  • But .. I can make a change and nothing ever happens.


    It sounds like you don't have "onSettingschanged()" in your app or not in the App Class...

    In eclipse, when you save the app settings, onSettingsChanged() is called in your app, allowing you to load the new settings....

    If you do, are the values you changing in the same scope as the values you use in your view?

    Sys.println() could be usefull to make sure onSettingsChanged() is called, etc....
  • Former Member
    Former Member over 9 years ago
    It sounds like you don't have "onSettingschanged()" in your app or not in the App Class...

    In eclipse, when you save the app settings, onSettingsChanged() is called in your app, allowing you to load the new settings....

    If you do, are the values you changing in the same scope as the values you use in your view?


    I do .. cause the app works perfectly on the device, and it does change the settings there as I change them. It is the simulator where the problem is.
    I just put a System.println in OnSettingsChanged and it did not give me any output. So that pretty much confirms that it is not going there.
  • So, you can change your app-setting on a watch while your app is running, correct? Not just change them and start your app with the new settings... This is where onSettingsChanged() comes into play...

    There is something out in your project or in your setup.

    Do you have "-"'s in the ID in the manifest.xml file (I heard this can cause odd stuff)

    Try this:

    Shutdown the sim and Eclipse, and then go to the bin directory for the SDK you are using and delete the "sys.nfm" file. (the simulator user this to track some things and it will be re-created)

    Start things back up and try again.
  • Former Member
    Former Member over 9 years ago
    So, you can change your app-setting on a watch while your app is running, correct? Not just change them and start your app with the new settings... This is where onSettingsChanged() comes into play...

    There is something out in your project or in your setup.

    Do you have "-"'s in the ID in the manifest.xml file (I heard this can cause odd stuff)

    Try this:

    Shutdown the sim and Eclipse, and then go to the bin directory for the SDK you are using and delete the "sys.nfm" file. (the simulator user this to track some things and it will be re-created)

    Start things back up and try again.


    The SYS.NFM thing fixed it. You sir are the master. I think that is at least 2x today. Thanks.