carp_context_package library

A sampling package for CARP Mobile Sensing that collects context data: activity, location, geofences, mobility features, weather and air quality.

Register ContextSamplingPackage with the SamplingPackageRegistry before you deploy a protocol that uses these measures. Works on Android and iOS.

Measure types provided (see ContextSamplingPackage for details):

Location permissions are best requested by the app itself, before sensing starts. See the package README for the platform setup.

Classes

Activity
An activity event recognized by the phone's activity recognition (AR) API.
ActivityProbe
Collects activity events from the OS's activity recognition (AR) API.
AirQuality
Air quality at the phone's location, from the World's Air Quality Index (WAQI) API.
AirQualityProbe
Collects local air quality for ContextSamplingPackage.AIR_QUALITY.
AirQualitySamplingPackage
The sampling package for ContextSamplingPackage.AIR_QUALITY.
AirQualityService
A connected device for the WAQI air quality web service.
AirQualityServiceManager
A DeviceManager for the AirQualityService.
CircularGeofence
A circular geofence with a center, a radius (in meters) and a name.
ConfigurableLocationProbe
Collects Location data for the ContextSamplingPackage.LOCATION measure.
ContextSamplingPackage
The sampling package for context measures: activity, location, geofence, mobility, weather and air quality.
ContextServiceManager<TDeviceConfiguration extends ServiceConfiguration<ServiceRegistration>>
Base ServiceManager for the online services in this package (LocationService, WeatherService and AirQualityService).
Geofence
A geofence event: entering, exiting, or dwelling in a geofence.
GeofenceProbe
Listens to location changes and reports a Geofence on the stream when the phone enters, exits or dwells in a geofence.
GeofenceSamplingConfiguration
The sampling configuration for a ContextSamplingPackage.GEOFENCE measure: one circular geofence with a center, radius, dwell time and name.
GeoPosition
A position in degrees latitude/longitude (GPS-style).
Location
A location fix from the phone, in GPS (WGS 84) format.
LocationManager
Singleton that gives access to the phone's location, also while the app is in the background.
LocationProbe
Collects streaming location information from the OS's location API.
LocationSamplingConfiguration
A sampling configuration for the ContextSamplingPackage.LOCATION measure.
LocationSamplingPackage
The sampling package for the location-based measures: ContextSamplingPackage.LOCATION, ContextSamplingPackage.GEOFENCE and ContextSamplingPackage.MOBILITY.
LocationService
A connected device that gives access to the phone's location.
LocationServiceManager
A DeviceManager for the LocationService.
Mobility
Daily mobility features computed from the phone's location.
MobilityProbe
Collects Mobility features for the ContextSamplingPackage.MOBILITY measure.
MobilitySamplingConfiguration
The sampling configuration for the ContextSamplingPackage.MOBILITY measure.
OMHContextDataPoint
A Data that wraps an OMH DataPoint produced from context data.
OMHGeopositionDataPoint
Holds an OMH Geoposition data point, transformed from a Location.
OMHPhysicalActivityDataPoint
Holds an OMH PhysicalActivity data point, transformed from an Activity.
Weather
Current weather at the phone's location, from the OpenWeather API.
WeatherProbe
Collects local weather for ContextSamplingPackage.WEATHER.
WeatherSamplingPackage
The sampling package for ContextSamplingPackage.WEATHER.
WeatherService
A connected device for the Open Weather web service.
WeatherServiceManager
A DeviceManager for the WeatherService.

Enums

ActivityType
The type of an Activity.
AirQualityLevel
Health category of an air quality index, following the WAQI scale.
GeofenceState
The position of the phone relative to a CircularGeofence.
GeofenceType
The type of a Geofence event.
GeolocationAccuracy
The precision of the location. A lower precision gives longer battery life.