CARP Data Backend
For Flutter plugins for other CARP products, see CARP Mobile Sensing in Flutter.
Upload of sensing data to the CARP web service can be done in four different ways:
Using the Plugin
import 'package:carp_core/carp_core.dart'; import 'package:carp_backend/carp_backend.dart';
Using the library takes three steps.
1. Register the Data Manager
First you should register the data manager in the
DataManagerRegistry.register(DataEndPointType.CARP, new CarpDataManager());
2. Create a CARP Data Endpoint
CarpDataEndPoint that specify which method to use for upload of data, and the details.
Upload methods are defined in the
For example, a
CarpDataEndPoint that upload data points directly looks like this:
CarpDataEndPoint cdep = CarpDataEndPoint(CarpUploadMethod.DATA_POINT, name: 'CARP Staging Server', uri: uri, clientId: clientID, clientSecret: clientSecret, email: username, password: password);
CarpDataEndPoint that uploads data as zipped files looks like this:
CarpDataEndPoint cdep_2 = CarpDataEndPoint(CarpUploadMethod.FILE, name: 'CARP Staging Server', uri: uri, clientId: clientID, clientSecret: clientSecret, email: username, password: password, bufferSize: 500 * 1000, zip: true);
CarpDataEndPoint that batch uploads data points in a json files looks like this:
CarpDataEndPoint cdep_3 = CarpDataEndPoint(CarpUploadMethod.BATCH_DATA_POINT, name: 'CARP Staging Server', uri: uri, clientId: clientID, clientSecret: clientSecret, email: username, password: password, bufferSize: 500 * 1000);
3. Assign the CARP Data Endpoint to your Study
To use the CARP Data Endpoint in you study, assign it to the study. And then start the study.
Study study = new Study(testStudyId, username, name: "Test study #$testStudyId"); study.dataEndPoint = cdep; // create a new executor, initialize it, and start it executor = new StudyExecutor(study); executor.initialize(); executor.start();
Features and bugs
Please file feature requests and bug reports at the issue tracker.
- Built-in types and core primitives for a Flutter application. [...]
- Support for asynchronous programming, with classes such as Future and Stream. [...]
- Classes and utilities that supplement the collection support in dart:core. [...]
- Encoders and decoders for converting between different data representations, including JSON and UTF-8. [...]
- Built-in types, collections, and other core functionality for every Dart program. [...]
- Interact with developer tools such as the debugger and inspector. [...]
- Mathematical constants and functions, plus a random number generator. [...]
- Lists that efficiently handle fixed sized data (for example, unsigned 8 byte integers) and SIMD numeric types. [...]
- File, socket, HTTP, and other I/O support for non-web applications. [...]
- Concurrent programming using isolates: independent workers that are similar to threads but don't share memory, communicating only via messages. [...]