SmartphoneStudy
A study that this phone takes part in, as seen by the SmartPhoneClientManager.
Identifies the study deployment and the device role this phone plays in it. The client manager creates one when you add a study (from a protocol or an invitation), then gets its SmartphoneDeployment and runs it.
Key points:
- deployment is
nulluntil the study is deployed, see isDeployed. - samplingState is the saved runtime state of the study, so sampling can resume after an app restart.
- events streams SmartphoneStudyStatusEvents on status and sampling state changes.
See also SmartphoneStudyController, which controls a running study.
- Inheritance
-
- Object
- Study<
SmartphoneDeployment> - SmartphoneStudy
Constructors
SmartphoneStudy.fromInvitation
- ActiveParticipationInvitation invitation
Creates a SmartphoneStudy from an invitation to a study.
The device role name defaults to Smartphone.DEFAULT_ROLE_NAME.
SmartphoneStudy.fromMap
Creates a SmartphoneStudy from a database row saved by the PersistenceService.
SmartphoneStudy
- String? studyId,
- required String studyDeploymentId,
- required String deviceRoleName,
- String? participantId,
- String? participantRoleName,
- DateTime? createdOn,
- StudyDeploymentStatus? deploymentStatus,
- SmartphoneDeployment? deployment,
Creates a SmartphoneStudy.
Properties
events
Stream of study status events.
isDeployed
Whether the deployment is available.
isSampling
Whether the study is sampling data, i.e. its samplingState is resumed.
participantId
The ID of the participant in this study.
participantRoleName
The role of the participant in this study.
samplingState
The sampling state of this study, or null if not yet sampled.
Setting it adds a StudyStatusEventTypes.SamplingStateChanged event to events.
studyId
The unique id of the study in the deployment service.
null for a local study added from a protocol.
Methods
toString
A string representation of this object.
Some classes have a default textual representation, often paired with a static parse function (like int.parse). These classes will provide the textual representation as their string representation.
Other classes have no meaningful textual representation that a program will care about. Such classes will typically override toString to provide useful information when inspecting the object, mainly for debugging or logging.