phyphox Forums
Run in the background - Printable Version

+- phyphox Forums (https://phyphox.org/forums)
+-- Forum: App-Feedback (https://phyphox.org/forums/forumdisplay.php?fid=6)
+--- Forum: Feature requests (https://phyphox.org/forums/forumdisplay.php?fid=8)
+--- Thread: Run in the background (/showthread.php?tid=61)



Run in the background - jbshute - 11-10-2018

For many purposes, it would make sense to have the app runnable if it is in the background. This should be doable.

Think about this example: I want to collect data about how people interact with their phones when they play a phone game. I active a remote session with phyphox, put the app in the background, and allow the user to play clash of clans. As they play, I trigger a recording in the background and log the data.


RE: Run in the background - Sebastian Staacks - 11-10-2018

That is on out todo list, but I cannot really say when we will start working on this and which limitations will apply. The difficulty is rather similar on Android and iOS, but I will describe it in Android terms, which are more familiar to me:

Phyphox currently runs entirely as a so-called "activity" (or, technically speaking several activities), which is code that is tied to the front-end shown to the user. This is started and stopped by the system and there is no way that an activity is executed more than a few moments after it is no longer in the foreground. Actually, we get a notification that the system is about to stop our activity and we only have a few moments to save our work before our code is no longer executed and our data possibly removed from memory.

The alternative is running the data acquisition as a so-called service. These services run without a front-end, but they need to add an icon to the notification area if they want to be executed all the time, so the users knows what is draining the battery. However, there will still be some limitation, some more obvious than others as both Android and iOS try to limit what a service can do as these tend to prevent the phone from going into deep sleep states, thus draining the battery. Other limitation will be access to the microphone and controll over sensor rates when other apps in the foreground try to use them as well.

In any case, the main reason that we cannot "just" add this feature, is that we need to restructure the app, so that the data acquisition and data analysis runs as a service while the user interface remains as an activity. This is a bigger task, which is on the list, but we do not yet know when we will have a look at this.

BTW: Technically, this is almost the same as the more common request to run the app while the screen is off, so people can keep measuring with the phone in their pockets.


RE: Run in the background - jbshute - 11-11-2018

What about the use of an overlay? Is that how messenger does it with the bubble??

Yes, I recognize there are some big hurdles to overcome here... I currently use a lock screen app to prevent the screen from being manipulated when I am doing experiments. Maybe a nice feature would be a way to block out the screen or make the pause/clear buttons more inaccessible to prevent accidental data loss?


RE: Run in the background - FN-3141 - 02-11-2020

Have you made any progress on this so far?


RE: Run in the background - Sebastian Staacks - 02-12-2020

Nope, sorry, we are still working on other things.


RE: Run in the background - martin - 03-21-2020

Hi

+1 for running in background feature.


Apart from that: GREAT app! Thanks for the work you put in here  Heart


RE: Run in the background - lscw - 11-27-2020

(02-12-2020, 01:30 PM)Sebastian Staacks Wrote: Nope, sorry, we are still working on other things.

+1 for this feature too. Although I appreciate just how much work it would be.

In the meantime, for situations where background running isn't essential it would be really great if the app resumed where it left off* rather than starting back at time=0 as can be seen in the image:

   

* and perhaps saved the time and attempted to resume while leaving a gap in the data?


RE: Run in the background - Jens Noritzsch - 11-28-2020

How did you manage to achieve that on the screenshot? If I resume an experiment, it just adds data to the right, just as you suggest…?

As for the gap: IIRC, we do this on purpose. Perhaps an option could be included in the phyphox file format at some point in the future.


RE: Run in the background - john.bullas@gmail.com - 12-06-2020

(11-27-2020, 08:43 PM)I am looking to use a mobile to measure location and vibration in transit so the turning the screen off and background running would be 'a given' in order to do this? Wrote:
(02-12-2020, 01:30 PM)Sebastian Staacks Wrote: Nope, sorry, we are still working on other things.

+1 for this feature too. Although I appreciate just how much work it would be.

In the meantime, for situations where background running isn't essential it would be really great if the app resumed where it left off* rather than starting back at time=0 as can be seen in the image:



* and perhaps saved the time and attempted to resume while leaving a gap in the data?