Git Product home page Git Product logo

Comments (8)

nilsbenson avatar nilsbenson commented on June 24, 2024 1

It's probably easier to just store in the settings a dictionary of steak index -> timer value. Then, when the apps starts up just restore all the timers to whatever duration they were the last time the app was run. That way users can configure potentially all of the available timers for specific uses and those become the default values.

from barbecueboss.

nilsbenson avatar nilsbenson commented on June 24, 2024

We can use either the object store (CIQ devices < 3.x) or AppSettings (CIQ >= 3.x) to store the list of timers and settings. Both things provide the same kind of functionality (key/value store of app data) but have slightly different ways of doing it. Also, I think AppSettings is the only thing that allows for companion app configuration of the values but I'm not really sure.

from barbecueboss.

arquicanedo avatar arquicanedo commented on June 24, 2024

I was digging into the Storage (https://developer.garmin.com/downloads/connect-iq/monkey-c/doc/Toybox/Application/Storage.html#setValue-instance_method) and it is only available in SDK >2.4.

I am realizing that my FR235 is super old and limited. This is a strong case to upgrade my watch. On the other hand, if we write the code for the oldest SDK then it works everywhere.

Another idea would be to maintain a basic app for old devices (e.g., dynamic-entries). And start a new one in the app store for modern devices (i.e., Menu2, Object Store, etc).

from barbecueboss.

arquicanedo avatar arquicanedo commented on June 24, 2024

This thread is helpful. I will work on this to persist on older devices.
https://forums.garmin.com/developer/connect-iq/f/q-a/211780/comprehensive-list-of-supported-ciq-versions-per-watch-past-and-future/995185#995185

getProperty()/setProperty can be used on older devices, and to determine with you can use:
if(Application has :Storage) { } else { }

from barbecueboss.

arquicanedo avatar arquicanedo commented on June 24, 2024

Even now that we can persist the last timeout, the time selector does not allow to set focus on an entry. Even if we created a custom menu (https://developer.garmin.com/downloads/connect-iq/monkey-c/doc/Toybox/WatchUi/Menu.html) this would not work easily because the menu is set to the first item all the time (i.e., Stop).

Menu2 allows it (https://developer.garmin.com/downloads/connect-iq/monkey-c/doc/Toybox/WatchUi/Menu2.html#setFocus-instance_method). This would be super clean.

Another option would be to have a "Stop, Last Timeout, 1, 2, ..., Custom."

from barbecueboss.

nilsbenson avatar nilsbenson commented on June 24, 2024

This is also very similar to what the built-in timer or alarm apps do. We don't have to add much to the UI, it makes sense and won't surprise anyone if the app starts up and has the timeout values from the last run. We would need to modify the duration picker to allow setting a time in it but that's not too bad.

from barbecueboss.

arquicanedo avatar arquicanedo commented on June 24, 2024

I really like the pulling of custom timers specific to that user. That's super useful. I would totally benefit from that.

I'm creating right now a custom Menu with the pulling of timers from the datastore. I hope to get this going today to have a proof of concept.

from barbecueboss.

arquicanedo avatar arquicanedo commented on June 24, 2024

This is working now. Closing.

from barbecueboss.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.