Announcement

Collapse
No announcement yet.

Sun rise / sunset

Collapse
X
  • Time
  • Show
Clear All
new posts

  • #31
    This is something where you want to look into using the object store. In the case of "pos", that will be null if GPS hasn't been used in a while, but what you can do is if it's not null, save it to the object store. Then in the case when it is null, use the info from the object store. (you'll have a fall back after the first time it's valid)

    And for tracking the "only run once a day", that's also something for the object store. When you calculate rise/set, save those time as well as the date in the object store, and when your app starts, load those values, and if the date is still the same, no need to calculate - just use the saved times. You'll want to add a check for midnight, as the date will change (maybe just null out the saved date so things get recalculated.)

    With your "sunsetCheck", you'll lose that if you go to the widget loop or an app and return to the watchface if you don't use the object store, and you'll recalculate each time to return to the watchface.

    As far as the difference in time, are you sure you're using your location? Are you seeing this in the sim or on the watch itself? With "simulate Data" in the sim, your using Kansas as a location.
    My Connect IQ Apps in the Store
    Facebook - Instagram -
    Twitter

    Comment


    • #32
      Thanks for the hint with the object store, i'll have a look at it!

      This snipped is just a snipped from my test environment and the code isn't that clean i know

      I tried it with my location. I replaced the codelines in the SunCalc class in the function calculate with my current GPS location. Additionaly i deployed the watch face on my Forerunner and after getting a GPS signal, i also got the incorrect times.

      Seems like i need to take a closer look and take a look at calculating sunrise/sunset if nobody got a fix or code snipped for calculation.

      Comment


      • #33
        Originally posted by ruperthawkes View Post
        but what about users of the 920XT for example, barrels are not supported
        Barrels should work work on 1.4.4* devices as well; I would start a new thread if you are having issues running apps built with them on up-to-date 1.4.4* devices.
        If you don't want to work with barrels though, or just want to see how they're implemented, you can always copy out the source files packaged inside.
        Last edited by asandweech; 01-10-2018, 08:52 PM. Reason: *More info from Travis

        Comment


        • #34
          Originally posted by asandweech View Post
          Barrels should work work on 1.x devices as well; I would start a new thread if you are having issues running apps built with them on up-to-date 1.x devices.
          If you don't want to work with barrels though, or just want to see how they're implemented, you can always copy out the source files packaged inside.
          1.X devices should run barrels...also the sim? I treid to import the barrel but when trying to run, i get the same error as ruperthawkes (Barrels are not supported by device).
          jim_m_58 suggested setting the minimum sdk version while running the sim to 2.4.X, but when i try to adjust the manifest file for the fr235 i get the error: Device 'fr235' does not support SDK version '2.4.0'.

          I'll try now to just copy the class from the barrel file and run that.

          Comment


          • #35
            The 235 is a 1.x device, so you probably want to use 1.4.x instead of 1.3.x This is in "run Configuration" where you set the target, not in the manifest.
            My Connect IQ Apps in the Store
            Facebook - Instagram -
            Twitter

            Comment


            • #36
              Barrels are not supported by all devices... the require vm support to work. All devices with ConnectIQ 2.4.x support should be fine. 1.x devices with support for 1.4.4 and later should work as well.

              Travis

              Comment


              • #37
                Originally posted by Travis.ConnectIQ View Post
                Barrels are not supported by all devices... the require vm support to work. All devices with ConnectIQ 2.4.x support should be fine. 1.x devices with support for 1.4.4 and later should work as well.

                Travis
                An overview page in the documentation of all devices (and their Apac counterparts) that shows the latest supported released Connect Iq version would be a handy thing to have (amongst others to see which device has barrel support, but this extends to all other functions in the api).
                Maintaining this overview would be a bit of a maintenance hell though. Perhaps it could be a page that can automatically be generated from your build system?

                My best Connect IQ apps:Other:

                Comment


                • #38
                  Originally posted by peterdedecker View Post

                  An overview page in the documentation of all devices (and their Apac counterparts) that shows the latest supported released Connect Iq version would be a handy thing to have (amongst others to see which device has barrel support, but this extends to all other functions in the api).
                  Maintaining this overview would be a bit of a maintenance hell though. Perhaps it could be a page that can automatically be generated from your build system?
                  We could do something like this, but the problem we encounter is that device firmware release schedules don't always align with our SDK releases. Any distributed docs with this information could easily get out of sync with what's actually available on devices. I agree that this is information we should probably make available, though. Even I would like that kind of reference--it's tough to keep track sometimes! Perhaps a page on the developer site would be a better place for this.

                  Comment


                  • #39
                    You can let the community contribute by forking and creating pull requests, then all you need do is review and merge.
                    There might be very active developers from time to time who will contribute.
                    Last edited by HermoT; 01-15-2018, 01:13 PM.
                    My Connect IQ apps
                    I only run so I can wear a Garmin!

                    Comment


                    • #40
                      Originally posted by Stanislav.Bures View Post
                      If is some problem with first barrel file so try this one. I have compiled it again with the last SDK
                      Hello there, thanks for sharing your code, but the file is not accessible for view or download. Can you please share it again? Thx!

                      Comment


                      • #41
                        Originally posted by cizister View Post

                        Hello there, thanks for sharing your code, but the file is not accessible for view or download. Can you please share it again? Thx!
                        You might have to login to view and download files. I did.

                        Comment

                        Working...
                        X