eclipseconnectiqmonkeyc

Why do my code changes not compile or show up when I run my MonkeyC program from Eclipse?


I am using Eclipse, the ConnectIQ add-on, and MonkeyC to write an app for a Garmin watch. I can run several sample apps on the simulator, but most of the time my edits don't deploy when I hit "Run".

IDE info: Eclipse IDE for Java Developers Version: 2018-12 (4.10.0) Build id: 20181214-0600

In the Garmin SDK's ActivityTrackerApp, the default UI is laid out in the file ActivityTrackerApp.mc. The lines I'm editing are:

var stepsPercent = info.steps.toFloat() / info.stepGoal; drawBar(dc, "Steps", dc.getHeight() / 4, stepsPercent, Graphics.COLOR_GREEN);

I'm editing the string "Steps" from these two lines and then I hit "Run".

I would expect to see the label "Steps" in the simulator changed to whatever new string I input, but the label appears unchanged. I tried restarting the simulator as well as killing the app within the simulator. I also tried cleaning and rebuilding the project several times with no change. I don't see any compiler errors, nor do I expect any. What does it take to get valid code changes to compile and deploy?


Solution

  • I found that I simply needed to save my changed files for the changes to be compiled. My confusion was based on Visual Studio in which this is done automatically. Not so in Eclipse, at least by default. Note that there is a setting to save automatically before build, though even after checking that setting I still have to manually hit save.