You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if (deploymentId != null) studyDeploymentId = deploymentId;
96
80
this.dataFormat = dataFormat;
97
81
_resumeSensingOnStartup = resumeSensingOnStartup;
98
82
_useCached = useCachedStudyDeployment;
@@ -119,7 +103,7 @@ final bloc = SensingBLoC();
119
103
120
104
The BLoC basically plays three roles:
121
105
122
-
* it holds core business data like `studyId`, `deploymentId`, `deviceRoleName`, and the`deployment` configuration
106
+
* it holds core business data like the `study`and `deployment` configuration
123
107
* it can create view models such as the `StudyDeploymentViewModel` and the list of `ProbeViewModel`s and `DeviceViewModel`s
124
108
* it provide a set of life cycle methods for sensing like `initialize`, `connectToDevice` and `start`.
125
109
@@ -132,7 +116,7 @@ Configuration of sensing is done in the [`Sensing`](https://github.com/cph-cache
132
116
This class also illustrates how the app can be run both in a "local" deployment mode and in different "CAWS" modes. Depending on the deployment mode (local or using CAWS), deployment is initialized using the [`SmartphoneDeploymentService`](https://pub.dev/documentation/carp_mobile_sensing/latest/runtime/SmartphoneDeploymentService-class.html) or the [`CarpDeploymentService`](https://pub.dev/documentation/carp_webservices/latest/carp_services/CarpDeploymentService-class.html), respectively.
133
117
134
118
In the case a local deployment is used, a protocol is fetched from the `LocalStudyProtocolManager`, which is then added to the local `SmartphoneDeploymentService`.
135
-
In the case a CAWS deployment is used, the study deployment configuration will be fetched from the `CarpDeploymentService` based on the `studyDeploymentId` fetched from an invitation (this invitation is fetched as part of the `init` method of the main `App` class).
119
+
In the case a CAWS deployment is used, the study deployment configuration will be fetched from the `CarpDeploymentService` based on the `study`, which again is part of an `invitation` (this invitation is fetched as part of the `init` method of the main `App` class).
136
120
137
121
Once, the right deployment service is configured, the `SmartPhoneClientManager` singleton is configured and the study is added (based on the deployment id and the role name of the phone) and deployed.
138
122
When deployed, the runtime (`SmartphoneDeploymentController`) is configured and sampling can now be started or stopped. This part of `Sensing` is shown below:
@@ -142,12 +126,11 @@ When deployed, the runtime (`SmartphoneDeploymentController`) is configured and
142
126
// (local or CAWS), add the study, and deploy it.
143
127
await SmartPhoneClientManager().configure(
144
128
deploymentService: deploymentService,
129
+
askForPermissions: true,
145
130
);
146
-
study = await SmartPhoneClientManager().addStudy(
147
-
bloc.studyDeploymentId!,
148
-
bloc.deviceRoleName!,
149
-
);
150
-
await controller?.tryDeployment();
131
+
132
+
study = await SmartPhoneClientManager().addStudy(bloc.study!);
The CARP Mobile Sensing Demo app makes use of many of the CAMS Sampling Packages. Each of these have their own requirements to work, which entails modification on how to configure and build the app on iOS and Android. You should pay special attention to the requirements described in the README of each sampling package. This often entails editing and modifying:
233
+
234
+
* the `info.plist` on iOS
235
+
* the `AndroidManifest.xml` file on Android
236
+
* the `MainActivity.kt` or `MainActivity.java` on Android
237
+
* the different `build.gradle` and `settings.gradle` files on Android
238
+
239
+
This example app also illustrates how these files should be configured.
0 commit comments