In Linux it's trivial to have long-running processes. In Android it's the opposite.
So I wonder if I create a Python script which runs 24/7 and collects the sensor data, if it will get killed at will by the OS or if it just runs the 24/7 like it would on Linux.
So more recent versions of Android have fixed the issue of killing background processes (Android 12), or Termux has found a programmatic way around it? Good to know.
My normal usecases are ssh sessions that run for weeks (months?) at a time and I run backups that takes up to an hour with rsync and have never had any issues. Not saying that there aren't usecases that will run into issues, I've just not run into it. Can't see how a python script running 24/7 collecting sensor data would have any issues.
And this has worked fine for me in every single android version since forever (long before v.12 and every version after) (though there have been some teething issues right after a new version is released, most notably permissions on storage. But last versions have been without any hassle that I can remember). There apparently are issues with more than 32 phantom processes or excessive CPU and some options to turn it off but it is not something I've ever had to do.
Maybe a problem with people trying to run a full featured linux distro with GUI support etc? Cool but never had a need. Termux environment is rich and powerful as it is.
Termux can definitely run for a long time even on Android 12 I think. I tried to put a web server to a Termux running on Chromecast (Android 12), and it is still running after months.
So I wonder if I create a Python script which runs 24/7 and collects the sensor data, if it will get killed at will by the OS or if it just runs the 24/7 like it would on Linux.