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.

Run in the background
#1
Question 
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.
Reply
#2
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.
Reply
#3
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?
Reply
#4
Have you made any progress on this so far?
Reply
#5
Nope, sorry, we are still working on other things.
Reply
#6
Hi

+1 for running in background feature.


Apart from that: GREAT app! Thanks for the work you put in here  Heart
Reply
#7
(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?
Reply
#8
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.
Reply
#9
(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?
Reply


Forum Jump: