LAMP Consortium

Recording time spent on other apps?

Hi all, is mindLAMP2 able to provide data on usage of other apps on the smartphone? e.g. time spent on instagram per day. Apologies if this is described elsewhere.

Many thanks,
Laurel Morris

​Hi,

Sadly not as Apple/Android do not allow such at that level.

Best,
John

Hi John, thank you, does this also apply to screen time, i.e. phone open/unlock versus phone sleep/off?
Thanks,
Laurel

​We can capture that data and use it to infer total screen time per day and number of open/closes of the phone.

Hi John,

Would this be the screen_state sensor? I haven’t been able to pull any data from the data thus far. Could you help me figure out what I might be doing wrong?

Thanks,
Marishka

Hi Marishka,

What exactly has the issue been that you are running into when you attempt to pull screen_state data?

Best,
Suraj

Hi Suraj,

Thank you for getting back to me. I have not been able to pull any data from the screen_state sensor. I have been using the following code:
LAMP.SensorEvent.all_by_participant(participant_1, origin=lamp_sensors[‘screen_state’])[‘data’] and it returns an empty dictionary.

For other passive data such as step count and distance the data has been sparse - maybe 1 or 2 days out of 30 days of app usage. And for the days we observe recorded data, the values seem unusually high >100,000. I am aware that there is ongoing work on new documentation, but we have been actively collecting data and are unsure if the data we have collected so far is correct. If you could let us know if there is something wrong with the way we have been setting up the app or pulling the data from server, it would be massively helpful.

Thanks,
Marishka

Hi Marishka,

Thank you for the detailed information about your issue. It sounds like your code is correct. The next step would be to make sure that you have added the screen state sensor to your participant’s study by following the instructions in the LAMP docs. Please let me know if screen_state is in your sensor spec.

With respect to steps data, LAMP typically logs steps data as “number of steps since a specific point in the past.” In other words, when you see high numbers at a specific timestamp, that does not mean that many steps were taken since the last timestamp, rather that that number of steps has been taken over some total period of time. We typically use this in analysis by calculating the deltas between timestamps and then summing them over a time period, for example to get steps in a day. If you try this, please note that you may have to zero out some negative deltas – we are currently investigating this issue, which we think occurs outside of LAMP.

I hope this info is helpful to you. Please let us know if we can explain more fully about either of these topics.

Hi Luke,

Thank you for your thorough response. I checked the LAMP profile and we don’t have access to screen_state sensor, see picture attached. In terms of sensors that have been added to the profile, I haven’t been able to gather data from the “sms” sensor either.

Thanks, so if I correctly understand, it is recommended that we use daily delta values? Would this also be true for distance then? And is there anything we can do to increase the number of days the data is recorded? For most days, we don’t even have a zero value, it is simply missing data.

Thank you for all the help!
Marishka

Hi Marishka,

I believe that device_state measures screen state. Could you try turning that on and seeing if things change?

And yes, in our analyses at least, we have found using the deltas between timestamps to be most helpful – although we typically calculate all the deltas between all timestamps and then combine across various intervals like hours or days depending on our needs.

With respect to increasing data collection rate, this is an issue that we are aware of and working on, so the best advice I can give right now is to make sure all relevant permissions are granted in the user’s phone’s settings. If you are having significant problems you can always try reinstalling the app (this can help with many passive data streams, not just steps).

Let me know if this helps!

Hi Luke,

Thank you for the thorough response.

We added device_state measure and it did not change anything. And this has been an issue with the sms data too.

Okay thanks, that is really helpful. I will change my code accordingly.

I will try to see if that helps with data collection.

Thank you for the recommendations, it is very helpful!