SmartPhoneClientManager class

  • Object
  • ClientManager<Smartphone, DeviceRegistration>
  • SmartphoneClient
  • SmartPhoneClientManager
Mixed in types


Get the singleton SmartPhoneClientManager.


deploymentService → DeploymentService?
The application service through which study deployments, to be run on this client, can be managed and retrieved.
no setterinherited
deviceController DeviceController
The controller of connected devices used to collect data locally on this primary device. Also works as a factory which is used to create DeviceDataCollector instances for connected devices.
no setteroverride
hashCode int
The hash code for this object.
no setterinherited
heartbeat bool
Is this client sending Heartbeat measurements for its studies?
no setter
isConfigured bool
Determines whether a DeviceRegistration has been configured for this client, which is necessary to start adding StudyRuntimes.
no setterinherited
measurements Stream<Measurement>
The stream of all Measurements collected by this client manager. This is the aggregation of all measurements collected by the studies running on this client.
no setter
notificationController NotificationController?
The NotificationController responsible for sending notification on AppTasks.
no setter
permissions Map<Permission, PermissionStatus>?
The permissions granted to this client from the OS.
getter/setter pair
registration ↔ DeviceRegistration?
The registration of this client.
getter/setter pairinherited
repository Map<Study, StudyRuntime<DeviceRegistration>>
Repository of StudyRuntime mapped to a Study.
getter/setter pairinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
state ClientManagerState
The runtime state of this client manager.
no setter
studies List<Study>
The list of studies deployed on this client manager.
no setter
studyCount int
The number of studies running on this client.
no setter


activate() → void
Called when this client manager is being (re-)activated by the OS.
addStudy(String studyDeploymentId, String deviceRoleName) Future<Study>
Add a study which needs to be executed on this client. This involves registering this device for the specified study deployment.
addStudyProtocol(StudyProtocol protocol) Future<Study>
Create and add a study based on the protocol which needs to be executed on this client.
askForAllPermissions() Future<void>
Asking for all permissions needed for the included sampling packages.
configure({DeploymentService? deploymentService, DeviceDataCollectorFactory? deviceController, DeviceRegistration? registration, bool enableNotifications = true, NotificationController? notificationController, bool askForPermissions = true, bool heartbeat = true}) Future<void>
Configure this SmartPhoneClientManager.
deactivate() Future<void>
Called when this client manager is being deactivated and potentially stopped by the OS.
didChangeAccessibilityFeatures() → void
Called when the system changes the set of currently active accessibility features.
didChangeAppLifecycleState(AppLifecycleState state) → void
Called when the system puts the app in the background or returns the app to the foreground.
didChangeLocales(List<Locale>? locales) → void
Called when the system tells the app that the user's locale has changed. For example, if the user changes the system language settings.
didChangeMetrics() → void
Called when the application's dimensions change. For example, when a phone is rotated.
didChangePlatformBrightness() → void
Called when the platform brightness changes.
didChangeTextScaleFactor() → void
Called when the platform's text scale factor changes.
didHaveMemoryPressure() → void
Called when the system is running low on memory.
didPopRoute() Future<bool>
Called when the system tells the app to pop the current route, such as after a system back button press or back gesture.
didPushRoute(String route) Future<bool>
Called when the host tells the application to push a new route onto the navigator.
didPushRouteInformation(RouteInformation routeInformation) Future<bool>
Called when the host tells the application to push a new RouteInformation and a restoration state onto the router.
didRequestAppExit() Future<AppExitResponse>
Called when a request is received from the system to exit the application.
dispose() → void
Called when this client is disposed permanently.
getStudyRuntime(Study study) SmartphoneDeploymentController?
Get the StudyRuntime for a study.
getStudyStatusList() List<StudyStatus>
Get the status for the studies which run on this client device.
lookupStudyRuntime(String studyDeploymentId, String deviceRoleName) SmartphoneDeploymentController?
Lookup the StudyRuntime based on the studyDeploymentId and deviceRoleName.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
removeStudy(Study study) Future<void>
Remove study from this client manager.
resume() Future<int>
Restore and resume all study deployments which were running on this client manager when the app was killed / stopped (e.g., by the OS).
start() → void
Start all studies in this client manager.
stop() Future<void>
Stop all studies in this client manager.
stopStudy(Study study) Future<void>
Permanently stop collecting data for study and then remove it.
toString() String
A string representation of this object.
tryDeployment(Study study) Future<StudyStatus>
Verifies whether the device is ready for deployment of the study runtime identified by study, and in case it is, deploys. In case already deployed, nothing happens.


operator ==(Object other) bool
The equality operator.