Communication Sampling Package
Collect phone calls, text messages and calendar events in a CARP Mobile Sensing study.
carp_communication_package adds the phone's call log, its text messages (SMS) and its calendar events to a CARP Mobile Sensing (CAMS) study. Use it in studies of social behavior and daily routines, such as how often a participant calls, texts or has appointments.
Calls and text messages come from Android only, because iOS gives apps no access to them. Calendar events come from Android and iOS. The package reads the call log with the call_e_log plugin, text messages with another_telephony and calendars with device_calendar_plus.
Google Play restrictions
Google Play treats the SMS and Call Log permissions as restricted: only apps with an approved use can request them. Research is not one of the exceptions, and an app that requests them can be rejected. To publish an app that collects only the calendar, see Google Play policy.
Features
Phone calls
The calls in the call log since the last collection: call type, duration, number and contact name. Android only.
Text messages
The messages in the inbox and the sent folder, with the other party's number, the text and the delivery status. Android only.
Calendar
The events in all calendars on the phone, including recurring and all-day events. Android and iOS.
Privacy
With the default privacy schema in the protocol, phone numbers, contact names, message texts and event titles are stored as SHA-1 hashes.
Measure types
| Measure type | Data | Android | iOS |
|---|---|---|---|
dk.cachet.carp.phonelog | The calls in the call log since the last run | Yes | No |
dk.cachet.carp.textmessagelog | All messages in the inbox and the sent folder | Yes | No |
dk.cachet.carp.textmessage | Each text message as it arrives | Yes | No |
dk.cachet.carp.calendar | The calendar events since the last run | Yes | Yes |
dk.cachet.carp.textmessage is event-based; the other three are one-time measures that collect once each time their task is triggered. For the difference, see Event-based and one-time measures.
Known issues in version 2.1.0
The call and message times in the phone log and the text message log fall in January 1970, and TEXT_MESSAGE adds no measurements. See Calls and text messages for how to recover the times.
Requirements
| Component | Requirement |
|---|---|
| Dart SDK | 3.10 or later |
| Flutter | 3.38.1 or later |
carp_mobile_sensing | 2.2.0 or later |
| Android | API level 24 (Android 7.0) or later |
| iOS | 15.0 or later (calendar only) |
How it works
Adding the package to a study takes three steps:
Register the package
Registering
CommunicationSamplingPackagemakes the four measure types known to CAMS and adds their privacy transformers to the default privacy schema.Add the measures to a protocol
The measures run on the phone, the protocol's primary device. Trigger the one-time measures repeatedly, for example every few hours.
Deploy the protocol
CAMS asks the participant for the phone, SMS and calendar permissions that the measures need, and then collects data each time a trigger fires.
This protocol collects the calendar every 3 hours and hashes event titles and descriptions:
Next steps
Installation
Add the package to a CAMS app and configure Android and iOS.
Quickstart
Build an app that collects calls, messages and calendar events.
Calls and text messages
What the call and message measures collect, and their data.
Privacy
Hash phone numbers, message texts and event titles before storage.