Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reuse last timer picked by the user #30

Closed
arquicanedo opened this issue Jun 4, 2020 · 8 comments
Closed

Reuse last timer picked by the user #30

arquicanedo opened this issue Jun 4, 2020 · 8 comments
Labels
next release enhancement New feature or request for next release research Research to be done

Comments

@arquicanedo
Copy link
Owner

Chances are that picking the last time is better than starting with a default value. This way is more natural to the cooking habits of each user.

I wonder if an app can write/read data from the watch filesystem. This would be a way to persist the last timer.

@arquicanedo arquicanedo added next release enhancement New feature or request for next release research Research to be done labels Jun 4, 2020
@nilsbenson
Copy link
Collaborator

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.

@arquicanedo
Copy link
Owner Author

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).

@arquicanedo
Copy link
Owner Author

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 { }

@arquicanedo
Copy link
Owner Author

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."

@nilsbenson
Copy link
Collaborator

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.

@nilsbenson
Copy link
Collaborator

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.

@arquicanedo
Copy link
Owner Author

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.

arquicanedo added a commit that referenced this issue Jun 9, 2020
@arquicanedo
Copy link
Owner Author

This is working now. Closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
next release enhancement New feature or request for next release research Research to be done
Projects
None yet
Development

No branches or pull requests

2 participants