Simulator disprecency

Former Member
Former Member
The following code

keyPressed= event.getKey();
dc.drawText(25, 80, Gfx.FONT_MEDIUM, keyPressed, Gfx.TEXT_JUSTIFY_LEFT);


works fine in the simulator but displays an error screen (IQ logo with exclamation mark) on a Forerunner 630.
  • The following code

    keyPressed= event.getKey();
    dc.drawText(25, 80, Gfx.FONT_MEDIUM, keyPressed, Gfx.TEXT_JUSTIFY_LEFT);


    works fine in the simulator but displays an error screen (IQ logo with exclamation mark) on a Forerunner 630.


    If you look at the CIQ_LOG.txt on the 630, you probable see a symbol error. on the drawText line for keyPressed. You're trying to display something that's not a string as a string.

    Try "keyPressed.toString()" instead.

    The simulator should catch this, but doesn't and it has been reported a number of times.

    Oh, also, is this in a deligate? (I guess it is because you're using event...) You must be saving the dc someplace, which could be risky.

    It might be better if you used Sys.println() to see the value instead of drawText. In the simulator, it will show in the console, and on the 630 if you pre-create <mayapp>.txt in the apps\logs directory, the output will go there. (that's also where ciq_log.txt should be)
  • Former Member
    Former Member over 9 years ago
    Thanks. Using toString indeed works properly both on simulator and watch.

    The dc code is in the view. I actually use getKey in the delegate and pass it to the view.