Skip to content

Smartphone

Configuration of an internet-connected smartphone with built-in sensors.

The usual primary device of a CARP Mobile Sensing protocol; its default role name is DEFAULT_ROLE_NAME. The CARP Core sampling schemes cover geolocation, step count, acceleration and angular velocity. Sampling packages in CARP Mobile Sensing add many more data types.

Inheritance
Annotations

Constructors

Smartphone.fromJson

Smartphone.fromJson(
  1. Map<String, dynamic> json
)

Smartphone

Smartphone({
  1. String roleName = Smartphone.DEFAULT_ROLE_NAME,
})

Create a new Smartphone device descriptor. If roleName is not specified, then the DEFAULT_ROLE_NAME is used.

Constants

DEFAULT_ROLE_NAME

String const DEFAULT_ROLE_NAME

The default role name for a smartphone.

DEVICE_TYPE

String const DEVICE_TYPE

The type of a smartphone device.

Properties

dataTypeSamplingSchemes

DataTypeSamplingSchemeMap? get dataTypeSamplingSchemes
override

Sampling schemes for all the sensors available on this device.

Implementations of DeviceConfiguration should return a map of all supported sampling schemes here. Null in this base class.

fromJsonFunction

Function get fromJsonFunction
override

The function which can convert a JSON string to an object of this type.

Methods

createRegistration

DefaultDeviceRegistration createRegistration({
  1. String? deviceId,
  2. String? deviceDisplayName,
  3. String? platform,
  4. String? deviceManufacturer,
  5. String? hardware,
  6. String? deviceModel,
  7. String? sdk,
})
override

Create a DeviceRegistration which can be used to configure this device for deployment.

Override this method to configure device-specific registration options, if any.

toJson

Map<String, dynamic> toJson()
override

Return a JSON encoding of this object.