Two suggest samples for the SDK

The folks at Garmin might not like this as it will mean more comments than code in some samples! ("real" programmers think comments are for the weak! :) ), but here I go:

1)a simple sample that shows how "something" should support multi-langages in the way designed by CIQ folks. A sample I can run in the simulator, and see a switch when I select language.

2) how to code a simple "something" for multiple devices, and again, how the Garmin CIQ folks say it should be done.

They probably should show direct "dc" calls as well as using layouts, in both cases.
  • agree. i have no idea how to properly code to support the few diff devices there are.
  • I will be happy for some sample of "Datafield" (not simpledatafield) :)
  • try github... extension:mc using toy box
  • Former Member
    Former Member over 10 years ago
    1)a simple sample that shows how "something" should support multi-langages in the way designed by CIQ folks. A sample I can run in the simulator, and see a switch when I select language.


    Have you looked at the Strings sample? It only provides translations for English (in that example it's the default language), German, French and Spanish but all languages will use that pattern. When you run that sample in the simulator you can select those languages and the words on the screen are updated. You'll also see what happens if you don't provide a translation for a specific language (try selecting Italian).

    It has been brought up before - and we have it noted as something to fix/add - that there isn't a way to translate a menu. Currently there isn't a way to reference string resources inside other resources but that's on the radar.

    2) how to code a simple "something" for multiple devices, and again, how the Garmin CIQ folks say it should be done.

    They probably should show direct "dc" calls as well as using layouts, in both cases.


    Right now the Layouts sample is the best thing to reference from what we've released. You'll be able to see how a base <drawable-list> and <layout> are defined for the "square_watch" and then overriden for the "round_watch". If you can stick to using resources (drawables and/or layouts) when defining your UI it should be pretty easy to adapt them for different screens.

    We do realize that there are some things you just can't accomplish using the resource system. In that case I think the generally accepted way of doing this is to save a string for each device via resources and then when it comes time to draw check what device you're on and have separate draw commands for each device.
  • Former Member
    Former Member over 10 years ago
    I'll also note that we're in the process of getting some more complex samples out there.
  • @Ken, I did not notice that was in the strings sample. Maybe there needs to be a readme for the samples directory, with a line or two about each sample describing what it does.
  • Former Member
    Former Member over 10 years ago
    I created a ticket to add a README to the samples directory. However, there is a samples section in the README for the SDK which I think contains the information you're looking for.

    -- Samples --

    There are many sample programs in the samples directory

    1. ActivityTracking - A sample using the step count and goal from the ActivityTracking API
    2. Analog - An analog watch face designed by Austen Harbour
    3. Attention - A sample that uses the Attention API to toggle the backlight, play tones, and vibrate
    4. C64Face - A digital watch for fans of the Commodore 64! Designed by Nicolas Kral (obviously)
    5. Comm - A sample that sends and receives strings with a phone app
    6. ComplexDataField - A sample that draws a graph using sensor data
    7. ConfirmationDialog - A sample showing how Confirmation Dialogs work
    8. Drawable - A sample that shows how the Drawable system works in resources.xml
    9. GameCube - A Playstation font watch face
    10. Input - A sample that uses a BehaviorDelegate to listen to behaviors and basic input events
    11. Layouts - A sample that shows how the Layout system works in resources.xml
    12. MathSample - A sample of math functions that shows the difference between using floats and doubles
    13. MO2Display - A sample that shows how to connect to*an ANT+ MO2 sensor device
    14. NumberPicker - A sample that shows how the Number Picker works
    15. ObjectStore - A sample that uses persistent storage
    16. PositionSample - A sample that shows the current position
    17. Primates - Another sample that uses input
    18. ProgressBar - A sample showing how the progress bar works
    19. RecordSample - A sample showing how to record Activities
    20. Sensor - A sample that graphs heart rate read from a sensor
    21. SimpleDataField - A sample data field that displays data read from sensors
    22. Strings - A sample that shows how translations work in the resource file
    23. Timer - A sample of how to use Timer.Timer to run code at a later time
    24. UserProfile - A sample that shows the data available from the UserProfile module
    25. Weather - A sample that uses makeJsonRequest to display the weather at your location
  • I created a ticket to add a README to the samples directory. However, there is a samples section in the README for the SDK which I think contains the information you're looking for.

    -- Samples --

    There are many sample programs in the samples directory

    6. ComplexDataField - A sample that draws a graph using sensor data



    I can't find this sample in the directory on the 1.1.1 SDK
  • I can't find this sample in the directory on the 1.1.1 SDK


    It's because it's not there. That's more reason that a readme for the the samples should be in the samples directory, as it is likely more up to date. I'm getting old and often forget what I read in an overall "readme" that I read a month ago as it is! :)
  • i was just trying to point it out "politely"
    I believe that many of us, in this forum, developing for ConnectIQ - it's merely and solely to scratch an itch (like open source SW) and by all means and purposes, "someone" supposedly would be appreciative to that despite the fact that they have quite a few launch partners (which I've not seen any apps from them yet - of which I await with bated breath)

    Hmm.. looks like that wasn't polite :-p