Skip to content
New issue

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

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

Already on GitHub? # to your account

Add ChromeWatcher #30

Merged
merged 1 commit into from
Sep 29, 2021
Merged

Conversation

miguelrochefort
Copy link
Contributor

ChromeWatcher is a watcher for Chrome. It's implemented as an accessibility service that, when enabled, is allowed to read the URL and title of Chrome's current tab.

Here's what it looks like:
image

Discussed here: https://forum.activitywatch.net/t/android-chrome-watcher/466

Fixes issue #29 (for Chrome at least).

@johan-bjareholt
Copy link
Member

The "Add missing dependencies" commit should be removed, you are not supposed to commit generated/compiled/transpiled/packaged files into git, only source code and scripts to generate/compile/transpile/package the files. Otherwise the git history will become huge.

@miguelrochefort
Copy link
Contributor Author

The "Add missing dependencies" commit should be removed

I removed that commit.

scripts to generate/compile/transpile/package the files

Where can I find those scripts? I found myself manually extracting these files from a published APK before adding them to my local build to make it work. It's not clear what the right way to do that is.

@johan-bjareholt
Copy link
Member

The Makefile has some targets to build aw-server-rust and aw-webui, other than that the grade scripts should be enough. Building instructions should definitely be added to a README file, sorry for that.

Looks good overall, but the only thing I'm afraid of is how the Play store looks at developers (ab)using the accessibility API. Maybe they won't even notice, who knows.

But I'll give the final review to @ErikBjare

@ErikBjare
Copy link
Member

ErikBjare commented Apr 19, 2020

Sorry for the delay, I'll take a look at it when I'm done with #32 so we'll actually have visualizations to show the data.

But looks wonderful, great work! 🥇

@miguelrochefort
Copy link
Contributor Author

we'll actually have visualizations to show the data.

What kind of visualizations?

Recently, I've been experimenting with a NotificationWatcher and a MultimediaWatcher for Android. Today, I was looking to experiment with interactive timeline visualization (haven't decided if web or native).

Let me know if you have more details or if you need help with anything. I'm available.

@8bitgentleman
Copy link

I don't know if it's within the scope of activity watch but it would be very cool to track how many times the phone is unlocked and or how many times the screen is turned on. It's an interesting metric to identify just how often you are checking your phone

@ErikBjare
Copy link
Member

What kind of visualizations?

@miguelrochefort The same ones available on desktop in its "Activity" view (the Android and desktop version will share the same view in the PR I linked).

Recently, I've been experimenting with a NotificationWatcher and a MultimediaWatcher for Android.

That would be really cool and would gladly be accepted!

Today, I was looking to experiment with interactive timeline visualization (haven't decided if web or native).

If you want to add new ones, you're always welcome! I'm not sure if we want to start building native visualizations (even though it would be nice) since all the querying is happening in the web UI.

So far we've been trying to share as much code as possible between platforms, and it would be nice to continue with that such that features/visualizations developed for one platform are available on all platforms. I'm also a terrible Android developer, so I wouldn't be of much help with any native development (which makes me hesitant to accept large chunks of native Android code).

I don't know if it's within the scope of activity watch but it would be very cool to track how many times the phone is unlocked and or how many times the screen is turned on. It's an interesting metric to identify just how often you are checking your phone

@8bitgentleman That would probably be a new watcher, pretty sure there's an API for that. Open a new issue if you're interested in that.

@8bitgentleman
Copy link

Would this watcher work for other browsers on android, for example the security conscious Brave Browser, which are based on Chromium?

@miguelrochefort
Copy link
Contributor Author

miguelrochefort commented Jun 6, 2020 via email

@benwr
Copy link

benwr commented Sep 28, 2021

Is there a plan for merging this? I'm considering whether to use ActivityWatch vs other time tracking tools, and this is an important feature for me.

@ErikBjare
Copy link
Member

@benwr Thanks for pinging.

It looks pretty good, so I'm just going to merge this and will test it properly (including seeing if I can get Firefox & Brave support to work) before the next release of aw-android (might take a while, unless someone helps out 🙂).

@ErikBjare ErikBjare merged commit 54df350 into ActivityWatch:master Sep 29, 2021
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants