Can termux not run in background?
i need to monitor cell status 2g/3g/4g and send it to another device
I am using termux-telephone for that and http request for sending it off
I have noticed termux-telephone stops working after I have switched over to another app, the script is still running but it won't retrieve the required data
any idea why
20 Replies
might be an android restriction
or you have battery settings on for termux
phantom process and all
if it was a battery setting the loop/http server would have stopped
be sure of that
yes
and if it's not that, well, might just be android restriction
maybe it asks for data too often
too fast
but apps like Tasker and automate are able to fetch this information
even in background
weird
maybe someone with more info could help more
maybe they have to get some kind of approval from playstore may be
it's same for termux-clipboard-get it will only get it when the screen in active
no idea, might be cause of termux-telephone itself
oh
did you try termux wake lock?
acquire wake lock
yes I do have this notification active
no
not the notification
ok
tap on acquire wakelock and try again
got it
if it works it will use more battery tho, cause your phone wont go into sleep mode
im pretty sure tasker and automate can get wakelock too, so it might just be cause of that
still didn't worked
just made a small script that detects if there is a change in clipboard and echo it every 2 seconds
"Clipboard" and "method:arg]"
were copied while the app was open and
"dogs" and "average"
were copied when the app was not in focus the 3rd one didn't showed