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

android app that reads from a file and has a persistent notification #4

Open
purarue opened this issue Oct 31, 2023 · 4 comments
Open

Comments

@purarue
Copy link
Owner

purarue commented Oct 31, 2023

reads from a cache file that a job writes to on computer/phone

could use tasker/termux to write every so often on my phone, incase computer is offline

displays all the items that have expired as a persistent notification on android

https://developer.android.com/develop/ui/views/notifications/channels

@purarue purarue changed the title android app that reads from a file and has a persistne tnoficiation android app that reads from a file and has a persistent noficiation Oct 31, 2023
@purarue
Copy link
Owner Author

purarue commented Oct 31, 2023

could probably just do this with termux-wake-lock and termux-job-scheduler instead of using some other third party app that requires root to schedule tasks

from what Im reading online doesnt seem to use that much battery, but will test and see how it fairs

@purarue
Copy link
Owner Author

purarue commented Oct 31, 2023

In fact, can probably optimize this quite a bit to only run when it needs to.

By syncing the resulting reminder file using file sync (syncthing or something else), can check when I open my terminal if its been modified in the last 15 minutes (can set the interval to cache it on my computer to 5 minutes)

If it hasnt been modified, that means my phone isnt able to sync with my laptop, so Im probably out/not on wifi, so should launch termux-wake-lock and termux-job-scheduler so it updates on my phone

can probably also just ignore sync-conflicts, deleting the files since this is just a cachefile thats generated

@purarue
Copy link
Owner Author

purarue commented Oct 31, 2023

@purarue
Copy link
Owner Author

purarue commented Oct 31, 2023

reminder that Id need to run termux-fix-shebang on the scheduled script, probably like

# cp script <new path>
termux-fix-shebang <new path>
chmod +x <new path>
termux-job-scheduler -s <new path> --job-id 555 --period-ms 900000
termux-wake-lock

900000 is the min allowed time (15m), job-id is to make sure we only have one ever running, just pick some arbitrary number

@purarue purarue changed the title android app that reads from a file and has a persistent noficiation android app that reads from a file and has a persistent notification Oct 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant