myneur / late

Garmin Smart Watch with Calendar & Weather
https://sl8.ch
55 stars 16 forks source link

Cleanup #4

Closed dawikur closed 5 years ago

dawikur commented 6 years ago

Firstly - thanks for this watchface, it is really nice.

I'm planning on playing with it to extend it for my own needs:

This is first step of it - initial cleanup. Those changes are not intended to refactor anything or change logic. It is simply removing unused code and reformatting it a bit.

Hope you like it :)

Next thing will be refactor of view - it is a bit messy.

What do you think?

PS. I am using eclipse as SDK guide suggests, so for my convenience and any future maintainer I did add project file for it.

gusals21 commented 6 years ago

Hello, I'm very new to Github, and I was wondering the same thing you were wondering, and I tried to put in more data like show HR, steps and calories. BUT i cannot seem to get it to work. If you have a working watch face with those features it would be wonderful if you can share. I really like this watch face but it seems like there is no HR feature that i'm looking for

kapuett commented 5 years ago

Did you receive any feedback from @myneur to merge this? This seems like a good first step, also concerning the add of calendar sync feature.

DenizUgur commented 5 years ago

@kapuett Calendar API is not available for Connect IQ SDK. If it ever gets available for us I'll be more than happy to contribute on that feature

dawikur commented 5 years ago

Unfortunately I haven't got any feedback on this. To be honest I had forgot about this PR :)

myneur commented 5 years ago

Hey @dawikur, it seems to me the the only think changed was a writing style and comments guiding further development were removed while I don't see any tangible improvements, so I don't see much value in the changes. But I'll consider adding more metrics. It is OK to fit there 2-3 metrics at the same time. There must be just a simple logic where to show what, because that changes with 1-2-3 metrics shown in parallel. It would be better to implement it through method(:methodLabel).invoke and set the layout up front so it is simpler and cleaner. Feel free to contribute if you want to create such logic.

myneur commented 5 years ago

@DenizUgur Yes, the calendar is not available through the API, but Garmin actually added a way to load data from internet, so it is now doable if you build a logic that authenticates a Google user and loads the data from Google calendar API:

https://developer.garmin.com/index.php/blog/post/guest-post-creating-a-connect-iq-background-service One of the new features in Connect IQ 2.3.x is background services, or the ability for a Connect IQ application to have a service that runs even if the main application isn’t running. Background services have different abilities than the main process; a watch face or data field that can’t do communications itself, but the background process can! The most common example of this right now is a watch face that displays weather information from the internet. When something happens in the background, that process can optionally prompt the user if they want to start the main application, or the background can just collect data for the next time the main application runs. https://www.programmableweb.com/news/how-connect-iq-brings-oauth-to-wearables/sponsored-content/2016/12/05

How to do it:

Occasionally people ask to cooperate on that but after the initial excitement nobody started yet. I unfortunately don't have much time for that. If you'd like to cooperate, I'd be happy to add the rendering part if you are able to do the data loading part. Just tell and I'll update the GitHub code to the latest version that updated the watch to Fenix 6. Best!

DenizUgur commented 5 years ago

@myneur Last time I tried to accomplish this I've encountered a problem with OAuth on Connect IQ. I don't remember the exact issue but I guess Google API was using OAuth2 and it wasn't possible from watch face. I didn't knew about background services. I'll try my best to accomplish it

myneur commented 5 years ago

Interesting @DenizUgur. It might be worth to test the reliability of the OAuth first then and proceed further only if it works well. I guess I saw that working on another Garmin app in a way that you need to log-in through the mobile Connect app first and once you do it, the watch can access the internet through the mobile on the background. Let me know if it worked please. Then we could make the calendar live. That would be awesome!

DenizUgur commented 5 years ago

@myneur Done. I'm opening a pull request now.