vmiklos / plees-tracker

Plees Tracker is a simple sleep tracker for your Android phone.
https://vmiklos.hu/plees-tracker/
MIT License
151 stars 38 forks source link

Add Alarm Feature #402

Open heberjeur opened 10 months ago

heberjeur commented 10 months ago

Can you add a new feature that allows users to set alarms in addition to the sleep tracking functionality? I don't want to have two separate applications for alarms and sleep tracking.

The addition of the alarm feature improves the overall user experience by providing a convenient way to wake up at a desired time while simultaneously tracking sleep duration.

vmiklos commented 10 months ago

Hmm, I guess all Android systems ship the built-in Clock app that has an alarm feature, so adding one more inside this app would be just a duplicate. What would be the selling point of a built-in alarm thing?

heberjeur commented 10 months ago

I have a built-in Samsung clock, but I don't have confidence in it. It sends a lot of information to their servers.

powerjungle commented 10 months ago

Not to make you unnecessarily paranoid, but I'm assuming the operating system is Samsung's own fork of Android. What makes you trust the whole system then?

What I'm trying to say is what you're trying to do has a different solution. The app is perfect the way it is. It does exactly what it needs to, no need to bloat it.

Lastaapps commented 9 months ago

Would be cool (not necessarily useful) that when you start tracking, the app schedules an alarm in your default clock app using the AlarmClock.ACTION_SET_ALARM Intent action automatically.

vmiklos commented 9 months ago

As long as this is opt-in, I don't oppose the idea. The question is what time to use for the scheduling, would that come from the "ideal sleep length" setting?

clicky6 commented 5 months ago

Would be cool (not necessarily useful) that when you start tracking, the app schedules an alarm in your default clock app using the AlarmClock.ACTION_SET_ALARM Intent action automatically.

For Now I have widget of Warpclock app for that. So just 2 taps on both the widgets of Pleestracker & Warpclock and it's done.

vmiklos commented 5 months ago

Are you interested in adding this yourself? I don't really have a use case for this, but I don't mind taking a PR.

Uniel commented 3 months ago

I too, am interested in this feature.

@vmiklos you mention it should be an opt-in feature. Based on the other comments I read on this repo, I think that is the right call. Do you have thoughts on how (or how not) to make the alarms accessible, without cluttering/annoying users, not interested in these features?

vmiklos commented 3 months ago

Do you have thoughts on how (or how not) to make the alarms accessible, without cluttering/annoying users, not interested in these features?

I guess one option is to add one more row in the settings activity. Most users should never set anything there, so it's fine to have a lot of settings there. Once once you enable the setting, it should ask for the alarm permission, etc.

The other complexity is tests: as you add more and more optional behavior, it becomes more and more hard to test all combinations. If somebody has an idea around the FIXME in

https://github.com/vmiklos/plees-tracker/blob/7a2a777a76cf7c52400699e3e9589b70ea3ab561/app/src/androidTest/java/hu/vmiklos/plees_tracker/MainActivityInstrumentedTest.kt#L74-L84

that would be interesting, since that trouble blocks getting closer to "every fix comes with a test", which would be my ideal.