This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

A cookie will be stored in your browser regardless of choice to prevent you being asked this question again. You will be able to change your cookie settings at any time using the link in the footer.

Screen Off for Long Term Experiments
#1
I don't know if there is a workaround for this already or if it would be a new feature request.

I want to run a long term experiment, where I leave the android phone in one location, untouched, plugged in, collecting data for days (at low enough frequency to keep the data manageable). I'd like to not have the screen have to be constantly on for the entire time. I'm happy to use remote access to monitor it and download the data when complete, but right now, any time an experiment is running, regardless of whether it was started locally or remotely, it keeps the screen on. I can't start an experiment remotely if the screen is off. As soon as I turn the screen off manually (because it won't turn off on its own setting), the experiment stops collecting data.

It may be the case that this is an inherent limitation in Android, but I haven't seen anything in the forums clearly stating that it is.
Reply
#2
Unfortunately, there is no simple solution to this. Both operating systems (Android and iOS) are quite aggressive to prevent apps from doing anything while the screen is off. The reason is that any app that does something on its own prevents the efficient use of hibernation states, so instead most common tasks are handed over to the system to manage the hibernation states. Apps that synchronize data in the background use scheduled wakeup times or push notifications from the system, apps that count steps do not really do so, but request the system to report the steps when the device is turned on again and so on.

To actually do something in the background when the app is not active (i.e. screen off or showing another app) we need to refactor most parts of phyphox to put the data acquisition into a service that is separate from the main app - and we do not have the capacity to do this (and even then I am not entirely sure if the system would allow all the things we need to do while the screen is off).

So, this is not something that phyphox can offer anytime soon.

However, there might be a slightly hacky workaround: In the phyphox settings (i menu on the main screen) you can find an option to use the proximity sensor to turn off the screen. This sensor normally turns off the screen when you are holding the phone to your ear during a call to prevent accidental input on the screen. If you turn on this feature, the system will turn off the screen while a measurement is running and while the proximity sensor detects something close to the display. You will have to place something on this sensor for it to trigger, so it is a bit hacky, but it might work for your usecase.

Here is an example of this feature being used to turn off the screen while phyphox is runnning measurements in a pocket: https://youtu.be/VBNgNMhrT0Q?si=oMTXPOBl_BZWpTX4&t=74
Reply
#3
That'll work perfectly! Thanks so much for the reply!
Reply


Forum Jump: