Complete

Simulator not changing setting, but keeps new settings as tmp file in TEMP folder

I am facing following behavior in the sim, any idea what can be causing this please ?

1.) Watchface starts OK in sim-> set files is created using default values from properties (Memory reports 74kB Memory peak and 380 objects peaks)
2.) Modifying settings using Connect IQ - App Settings editor in Eclipse
3.) Clicking Send Settings
4.) After some time new settings processing finishes, NO changes are reflected on watchface (Simulator reports Peak Memory 82.6kB and 569 peak objects)

In the file system TEMP directory where sim is pointed i can see new file  "temp_appsettings<multiple_random_digits>.tmp" has been created on same level as GARMIN folder, but set file has not been replaced with new data.
In rare occurrence new set file is created but has 0bytes size. Working SET file has 3.98kB

  • yes, actually last test was run on reinstalled system(windows), new installation of eclipse and even code has been done by copy paste to the new project. After each failure, i am also completely wiping TEMP directory with all garmin data. Still, at the moment i will register onTemporalEvent, settings changes are reflected, but set file which existed before is deleted (in fact set file delete happens regardless whether onTemporalEvent is triggered by settings change or by manual trigger thru 'Simulation -> Background Event' menu without settings change). If i will not activate onTemporalEvent, changes are reflected and SET file with updated settings stored to the file system Garmin\Apps\Settings reliably.
  • This used to work before you made changes, correct?  I'm wondering if it's something in your environment.  Have you tried things like rebooting your system, deleting and reinstalling the SDK, etc? Deleting every thing under apps in the sim's temp directory?
  • After other set of test, problem starts as soon as i will add following code to register for temporal event.
    if (Toybox.System has :ServiceDelegate) {
        	Toybox.Background.registerForTemporalEvent(new Time.Duration( 5 * 60));
    }
    Till i add it all works as a charm. Background starts to run, but no settings are processed anymore. Therefore I though it may be due to the code which is inside of the background therefore i stripped it to following:
    (:background)
    class WeatherServiceDelegate extends Sys.ServiceDelegate {
    	
    	function initialize() {
    		Sys.ServiceDelegate.initialize();
    	}
    	
    	
        function onTemporalEvent() {
        	Sys.println("Entering onTemporalEvent");
        	var systemStats = System.getSystemStats();
        	var output = "d";
        	Sys.println("Memory (total/used/free):" + systemStats.totalMemory + "/"+ systemStats.usedMemory + "/" + systemStats.freeMemory);
        	Sys.println("Exiting onTemporalEvent");
    		Background.exit(output);		
    	}
    Background runs fine, problem still persist. As soon as i will comment out registerForTemporalEvent, all works again. Any idea ?
  • No, in whole watchface properties, resources, ... anything in xml is read only.
  • So no were in the process are you trying to write something that is a property in the xml?