Razeeman / Android-SimpleTimeTracker

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

Support for automatic activity tracking? #11

Closed heythere797 closed 1 year ago

heythere797 commented 3 years ago

What I mean is that could you add a feature such that the time spent in that app is automatically counted towards a certain activity without having to manually set the activity every time I spend a certain amount of time in an app?

Like other people I switch apps constantly, and its kind of hard to figure how much time exactly I spend on each app

heythere797 commented 3 years ago

BTW, really nice app and thanks for all the work on it!

seefernando commented 2 years ago

I do this with Tasker, I post to a personal api when I focus and de focus an app. It would be awesome if there was a way to instead have tasker log activities locally. I don't see any options that could work in tasked currently though.

EncroachGradually commented 2 years ago

Tasker integration would be great a couple of uses

KAGEYAM4 commented 2 years ago

@seefernando how to do this, can you please explain or export the profile, thank you

Razeeman commented 2 years ago

Related issues:

10

41

44

Sorry for the late response. Thank you all for the great suggestion. At first this was looking like an enormous feature that would require a lot of different app permissions. But adding integration with third-party applications for automating tasks is a very easy and elegant solution. I've added intents that can start and stop activities from other apps like Tasker. Also added description about automated tracking with specific values to use (Settings - Additional settings - Automated tracking).

Description looks like this:

To enable this behaviour these applications should support sending "intent" or "broadcast intent" with these parameters:

Action - "com.razeeman.util.simpletimetracker.ACTION_START_ACTIVITY" or "com.razeeman.util.simpletimetracker.ACTION_STOP_ACTIVITY". Extra - "extra_activity_name" with activity name that should be started or stopped. Package - "com.razeeman.util.simpletimetracker".

Optional parameters for starting activity: Extra - "extra_record_comment" with record comment. Extra - "extra_record_tag" with the name of a record tag.

It will be in the next release. But if anyone want to check if it will work correctly I can build a debug version with these changes. Thank you all for the help!

ColdHotman commented 2 years ago

@Razeeman

I'd love to help out with testing a debug version, I'll use NFC/RFID and NFC Tools to trigger intents and would be happy to report any bugs I find.

Razeeman commented 2 years ago

@ColdHotman

Hello! Thank you for the help. I've attached debug version in the current development state. It will install separately from the release version, so your data wouldn't be affected, but just in case make a backup file before trying it. New release was planned for this weekend, so if you find any bugs before this, I would be able to fix them right away.

app-debug.apk.zip

ColdHotman commented 2 years ago

@Razeeman Thank you for the debug version, here are my results:

Intents work great!


com.razeeman.util.simpletimetracker.ACTION_START_ACTIVITY, com.razeeman.util.simpletimetracker.ACTION_STOP_ACTIVITY, extra_record_comment and extra_record_tag

through

com.razeeman.util.simpletimetracker.debug

tested OK on physical hardware, NFC tags.


Multitasking tested OK.


I am able to write NFC chips that, when scanned, starts and stops any pre-defined activity along with a comment or tag if I want (due to limitations in third party app, wasn't able to test both comments and tag at the same time).

Screenshot_20221117-161656_Debug Simple Time Tracker

If there's any undocumented intents or use cases that needs further testing, I'm happy to help. I tried to test everything available through intents and can't think of anything else.

This is pretty cool, thank you for implementing the function, offering me the debug apk and planning on updating the main app!

pat-richter commented 2 years ago

Can't wait for it. Seems I've restarted my TimeTrackingApp research with perfect timing! Thank you, this is really awesome!

Razeeman commented 2 years ago

@ColdHotman Great! Thanks again for testing everything.