Connect IQ 2.1 SDK Preview!

The Connect IQ version 2.1 preview SDK is now available on the developer site!

We're excited about this release because it adds a bunch of new features that many Connect IQ developers have been asking for, like custom FIT recording, OAuth, Widget & App support for Edge products, and more! You can find out all about it and download it here:

http://developer.garmin.com/index.php/blog/post/connect-iq-2-biker-monkey

Since this is a preview, you won't be able to export apps for submission to the app store, but you can build apps to side load to your own device for development and testing purposes. Please give it a try! If you have feedback or notice any bugs, you can post to this forum or send your comments to the Connect IQ team at [EMAIL="[email protected]"][email protected][/EMAIL].

Thanks!

- The Connect IQ Team
  • How can I guess from the description above, that right variant will be:
    { :order=>SH.ORDER_NEWEST_FIRST, :period=>10}
    - ORDER constants hard to find.
    - what are the units of Duration? Seconds? Msec? Minutes? Please describe.


    In this case, the period is the # of samples (10) and you'll see them in the order where the newest one is first. For HR, I see that the samples are 2-3 minutes apart, but not sure with temperature (there's a bug in the va-hr beta FW and can't try it yet).

    If you provide a duration for the period (a duration object), you are able to say "I want readings for the last 30 minutes" no matter how many readings that is. Look in the documentation to see how to create a duration. (Time::Gregorian). I've not tried a duration, and have only been using the # of samples.
  • The documentation you pasted describes the behavior pretty well. If you pass an object of type Number for the period (as you do in your example using the value 10), then you should get that many results. i.e., if you pass 10, you should get an iterator with 10 results. Like this...

    var options = {
    :order =>SensorHistory.ORDER_NEWEST_FIRST,
    :period => 10
    };
    var iterator = SensorHistory.getTemperatureHistory(options);


    If you pass a Duration for the period, you will get samples for that duration. It seems that you have not noticed that Duration is a class with its own documentation. When you initialize a Duration it takes the number of seconds as a parameter. You can also create one by subtracting two Moment instances (e.g., Time.now().subtract(Time.today()) would get a Duration representing the time since midnight).

    Anyway, the following code would get you results for the last 5 minutes.

    var options = {
    :order =>SensorHistory.ORDER_NEWEST_FIRST,
    :period => new Time.Duration(5 * Gregorian.SECONDS_PER_MINUTE)
    };
    var iterator = SensorHistory.getTemperatureHistory(options);
  • The Math functions are pretty standard (from languages like C, Java, Python, ...), and in those languages the result is always a floating-point value of some type. The documentation does indicate that the result is of type Float. If you want a Long (which is a class-type documented here), you have to ask for it...

    round(123.456).toLong()
  • Thanks for explanation. That is my question to improve documentation, so I don't need to browse all the pages to find Duration object and have only click to hyperlink in document to access all necessary information.
    In other cases it becomes time consuming. Don't waste developer's time.
  • Is there any way to know length of the array? Of course, yes, but it is not well-described.
    This code does work for array, but example is in Loops section:
    // Monkey C does allow for variable declaration in for loops
    for( var i = 0; i < array.size(); i++ ) {
    // Code to do in a loop
    }

    Please correct documentation.
  • Former Member
    Former Member over 9 years ago
    Still no Cycling Dynamic values supported?

    Seems like DI2 values already been included in 2.1.0 but Cycling Dynamics still not available until 2.1.0?

    So sad....
  • Is there any way to know length of the array?

    If you want to know how to get the size of an array, look to the documentation for the class. It is right there in the documentation.
  • I faced with the absence of the function trunc().

    There is no need for this function, as the Float and Double classes already have the toNumber() and toLong() conversion functions which do exactly what you want. Again, you're asking for something that is already documented.

    Travis
  • Former Member
    Former Member over 9 years ago
    Can anyone successfully export a 2.1.0 package from Eclipse Mars? A simple starter app builds ok, and sideloads just fine. When I try to export I get "App export failed see console". But there are no errors in the console. Help please.
  • Shark - From the first post in this thread:

    Since this is a preview, you won't be able to export apps for submission to the app store, but you can build apps to side load to your own device for development and testing purposes.


    You need to use 1.2.x to build a .iq for now.