Razeeman / Android-SimpleTimeTracker

Simple app that tracks time.
GNU General Public License v3.0
595 stars 73 forks source link

[FR] Add manual record using an Intent #203

Closed saadulkh closed 1 month ago

saadulkh commented 1 month ago

This feature is about adding an additional intent to the existing supported intents to add a manual record automatically.

For example, given a start and end time through an intent, add a record to the list. Same as what we can manually do right now through the + FAB in records tab.

This helps greatly with off-device tracking like using IoT devices, and then seeing all the logs in one place.

Razeeman commented 1 month ago

Hello! Thank you for the feedback, seems like a useful feature. Start and end time that will be in the extras should probably be in the utc timestamp format. Will this be ok? Or some other format is preferred? For example yyyy-MM-dd HH:mm:ss

saadulkh commented 1 month ago

There can always be some preprocessing done at the automation app side. So, this app can expose whatever interface works for it. Like if the app is internally using UTC timestamps, then it can accept that format through intents, but works otherwise too. I would say just avoid introducing such complications for just this feature. Go with whatever is already being used.

yyyy-MM-dd HH:mm:ss is a good first choice. Obviously, the "best" format always depends upon user choice. For now we can just support one or 2 common ones, unless we get FRs for some specific formats. Here is list of some common formats.

dgudim commented 1 month ago

+1 Just commenting here to get notifications. My usecase is insertion of sleep activity after syncing with my watch

Razeeman commented 1 month ago

Added new action in the latest commits, will be in the next release.

Action - \"com.razeeman.util.simpletimetracker.ACTION_ADD_RECORD\" with extras: \"extra_activity_name\", \"extra_record_comment\", \"extra_record_tag\" and \"extra_record_time_started\", \"extra_record_time_ended\" in the format \"yyyy-MM-dd HH:mm:ss\" or UTC timestamp.

saadulkh commented 1 month ago

Thanks for your effort and great work. Appreciated.