Data collection from most data sources in Ethica happens behind the scenes and without any participant involvement. After participants join your study and consent to its terms, if your study involves any of the automated data sources, Ethica will be continuously running on participant's phone, capturing data, encrypting them, and uploading them to the server.
Such background operation with minimum user interaction is necessary to reduce participant's burden during the study and prevent Hawthorne effect. But both Android and iOS operating systems are designed such that when an app is not used by the user very often, they stop and terminate it.
There are many factors which determine if and when the operating system terminates an app, including but not limited to:
- How much resources (e.g. battery or processing power) is the app using?
- The version of the Android or iOS.
- How much battery has remained?
- Is there any intensive important app currently running (e.g. Skype during a video call)?
- Make and model of the phone.
Based on these and other similar factors, Android and iOS might decide to terminate Ethica in order to free space for other more important apps, which in turn leads to incomplete data for your study.
We are always working to prevent unexpected app termination as much as possible. For the most part, you don't have to be worried about the details. At the same time, there are a few items discussed below which you need to be aware of in order to improve the data quality.
Keeping the Study Light
One of the important factors which cause an app to be terminated is the amount of resources it consumes. If the data sources you monitor for your study generate lots of data, Ethica will use more resources for the storage, encryption, compaction, and upload. This, in turn, will increase the chances of app termination. Therefore, it's very important for you to make sure your study only collects data from necessary data sources.
Not all data sources generate the same size of data. For example, pedometer generates a record everytime a step is being captured, or GPS generates less than 50 records on each cycle. But some data sources such as Accelerometer, Gyroscope, Magnetometer, and other software- or hardware-based motion sensors generate thousands of records per cycle. Using such data sources in your study can increase the chance of the app being terminated.
In most cases, it's better to replace raw motion-sensor data (accelerometer, magnetometer, gyroscope, linear acceleration, gravity, and orientation) with their high-level equivalent data sources (motion-based activity recognition and pedometer). They can provide you data which is easier to analyze, and multiple orders of magnitude smaller in volume.
Even if you have to collect raw motion-sensor data, you probably need either the raw data from hardware (i.e. accelerometer, magnetometer, and gyroscope) or software-based sensors (i.e. linear acceleration, gravity, and orientation). Collecting all these sensors is almost always unnecessary as the software-based sensors can be derived from the raw data from hardware.
Background Activity in iOS
Unlike Android, iOS is very strict in applications perform background activity. In their App Review guidelines, Apple has defined a few categories, and only apps in those categories are allowed to perform any background activity. Unfortunately, research applications are not one of those categories, though location-aware applications are. In other words, while an application is actively using GPS, it can remain alive in the background and perform other tasks as well.
Ethica uses the category of "GPS-based apps" to remain active while not visible. That means it requires to actively use GPS in order to perform any task in the background. Therefore, if your study uses continuous monitoring of data sources, whether including GPS or not, Ethica will ask the participant for GPS permission:
If your study does monitor GPS, Ethica will capture accurate GPS records and uploads them periodically together with other data sources. If your study does not require GPS, Ethica "pretends" to be using GPS by asking for very coarse GPS location, but it does not store nor upload those GPS data. This allows Ethica to remain active in the background to record and uploads other requested data sources while minimizing battery consumption.
Handling App Termination in iOS
Ethica in iOS automatically detects if it's been terminated by the iOS operating system or not. If yes, it shows a message to the user asking them to open Ethica. Clicking that notification will simply open the Ethica app which is enough for Ethica to resume its operation. Ethica only sends one notification when it detects the app is terminated. If the user discards this message, at the moment Ethica will not send any additional reminder. If the user opens the Ethica app and iOS terminates the app again, Ethica will prompt another notification to the user.
Background Activity in Android
Android handles background applications different than iOS. Therefore, the model described for Ethica iOS does not apply to Android users. In Android, applications who wish to run continuously in the background are required to have a Sticky Notification: a notification is shown on the top of the screen like normal Android notifications, but cannot be dismissed by the user.
Such notifications tell Android "this application is performing an important task for the user, and it should not be terminated as long as possible.
Sticky Notifications can be annoying for some users and might force them to drop out of the study. Therefore Ethica allows users to disable Sticky Notifications through Ethica Settings if they choose to. Of course, disabling Sticky Notifications will make the app subject to termination by the Android, and can impact the data collection for the study. While Ethica informs the user about such impact, it respects their choice if they decide to disable Sticky Notifications.
Device Specific Settings
Unlike iOS, Android smartphone manufacturers can potentially modify the Android operating system shipped on their smartphones and make it incompatible with standard Android protocols. Therefore, some of the assumptions which Ethica operates on can be invalidated on some smartphones.
The only smartphones we are aware which behave differently standard Android are Huawei devices. By default, Huawei discards all Sticky Notifications, making the app more susceptible to be terminated by Android. Moreover, the Android version shipped on Huawei devices more aggressively terminates background applications. In this case, even scheduled survey prompts might not be shown to the user on time until they open the Ethica app. Participants should perform the following steps on their phone in order to disable such behaviour on Huawei devices.
- Go to Android Settings.
- Select Apps.
- From the bottom of the screen, choose Settings.
- Choose Special Access.
- Choose Ignore battery optimization.
- From the top of the screen tap on Allowed to open the list and choose All apps to see the list of all applications.
- From the list of all applications tap on Ethica.
- Select "Allow: May drain your battery more quickly"
- Press OK.
Automatic Adherence Reminder
While the methods described above can allow Ethica to run in the background and collect the required data, there are still things which can go wrong and prevent the data collection and upload. Especially in longitudinal studies, where the participant installs Ethica on their phone and they just assume it's working as expected, app interruption can go on for days without being noticed. Even when the participant discovers it and resumes the app, potentially a large and important amount of data might already be lost.
To prevent such cases, Ethica allows you to define policies for your study to send automatic reminders to participants who have not provided any data for an extended period of time. Here the assumption is that the participant is expected to have occasional Internet connectivity and provides the data periodically. If your participants can remain offline for a long period of time during the study, this approach will be less effective.
You can define an automatic adherence reminder for your study either while you are creating the study, or afterward, by editing the study. The following screenshot shows the Automatic Adherence Reminder settings while creating a study:
As you can see above, you can choose to send a reminder in two cases, each described below.
The first is to set a reminder after the participant has not uploaded any data for a certain number of days. You can pick between 1 to 3 days for this option. Ethica will monitor the data upload from each participant, and if they have not uploaded any data for the specified number of consecutive days, it will send them a reminder.
The second option is to send a reminder after the participant has not responded to a certain number of consecutive surveys. Note that sending adherence reminder based on missing surveys only includes the Scheduled Trigger surveys, as their expected response time is known in advance. Other survey types such as User Triggered or Proximity Triggered surveys are not supported here.
The reminder is sent on 6 pm local time to each participant. Ethica servers will send a reminder every day or after each additional missing survey, depending on your settings, until the participant continues to contribute data again. Therefore Participants might receive multiple reminders in this case. The following image shows such reminder on Android devices.