Some watches' settings not able to change in simulator

I having a problem where some watches' settings aren't changing in the simulator. For example: I can change the settings in the "App Settings Editor" just fine for the Venu, but with the D2 Charlie all I'm getting are the default settings; all the changes I make have no effect.

There are also some other models that I can change settings with and some I can't. Does anyone have any ideas why this is happening? Under the resources all I have are some fonts and some images.

Do you think maybe it has to do with available memory?

Thanks.

Top Replies

All Replies

  • You don't want to use the app settings editor in eclipse anymore.

    In the sim, you use

    File>Edit Persistent Storage>Edit Application.Properties data

  • That's what I'm using.

  • I have seen issues with data field settings and running out of memory in the past, but only with devices with very low amounts of memory (e.g. FR230).

    D2 Charlie has 128 KB for data fields and 1280 KB for device apps, so I doubt that's the case here, otherwise you should see the problem for most or all devices.

    Then there's the fact that Venu actually has less memory for devices app and data fields than D2 Charlie, yet it works for you.

    OTOH, D2 Charlie's limit for watchfaces is 98304 but Venu's is 524288.

    If your app is a watchface, it's possible that it's a memory problem. When you run your app, how much free memory is typically available (as reported by the simulator)? What's the peak memory?

  • For the D2 Delta it is saying 88.7 / 92 kB.

    For the D2 Charlie it is saying the same exact amounts and also is not working correctly.

    I have a couple functions that run when the settings change and when the watch face starts. It says that they are running via system output messages.

    I have to go through them all to see which ones are working and which ones aren't. The fenix 5 plus also isn't working and has the same amount of memory.

  • For the D2 Delta it is saying 88.7 / 92 kB.

    Hmm that is cutting it very close. Based on that, I would guess that the memory usage for your app properties (settings) is 3 KB or more.

    When your app receives settings there is typically a big memory spike, because (roughly speaking) your app needs to store 2 copies of your settings in memory at once. (Not 100% sure, but I think your app may receive settings as a big JSON blob, then deserialize them into a dictionary, so while that's happening, both the JSON and the dictionary have to be present in memory at the same time)

    Some things you can look at for saving memory with settings:

    - reduce the length of settings property key names

    - reduce the number of settings

    In general, if you can avoid calling loadResource at all, you can save a ton of memory too. This is because one call to loadResource will load the entire resource table into memory, and it will never be unloaded. (The resource table only has references to resource IDs, not the contents of the resources, but it's still pretty huge.)

    If you must load resources, you can also try reducing the number of resource strings you use. Each resource string will take up an entry in the resource table, even if it's not used by the app. (This includes strings used by settings.)

    You can also search the forum for topics on saving memory by refactoring your code. (Unfortunately most of the advice causes your code to be hard to maintain and understand :/)

    EDIT:

    IIRC, what happens when your app runs out of memory when it receives settings is that your app crashes and settings are reset to default. This can also happen on a real device as well as the simulator (I've seen both.)

  • In the sim, with no app running, try "File>Reset All App Data" and "File>Delete All Apps" (or just close the sim and delete it's temp directory).  The sim can get confused if you rename an app.

    If you change settings, Save then close, and open settings again, does that show the changes?

  • I tried the resets, but where could I find the temp folder?

  • Thanks, I believe that this is the problem.

  • I got it working by modifying my code, and lowing the memory used.

  • Nice!

    For future reference the simulator temp dir is in:

    (Windows) %TEMP%\com.garmin.connectiq\GARMIN

    (Mac) $TMPDIR/com.garmin.connectiq/GARMIN

    You'll see a file layout which looks just like the file system on the watch. Apps will be under GARMIN\APPS. Other folders of note are:

    GARMIN\APPS\SETTINGS

    GARMIN\APPS\LOGS

    GARMIN\APPS\DATA