Skip to content

Sensors

class Sensors

Availability of motion sensors on the device, as returned by BackgroundGeolocation.getSensors.

These sensors power the SDK's motion activity-recognition system. When a sensor is absent — particularly on low-end Android devices — motion recognition performance degrades and the SDK may rely more heavily on location-based heuristics.

final sensors = await BackgroundGeolocation.sensors;
print('[Sensors] ${sensors}');

Members

accelerometer

bool accelerometer

true when the device has an accelerometer.

gyroscope

bool gyroscope

true when the device has a gyroscope.

magnetometer

bool magentometer

true when the device has a magnetometer (compass).

motion_hardware

bool? motionHardware

iOS only true when the device has a dedicated M-series motion co-processor (iPhone 5S and later). The M-series co-processor offloads motion activity recognition from the main CPU, enabling low-power step counting and activity detection.

platform

String platform

OS platform name: "ios" or "android".

significant_motion

bool? significantMotion

Android only true when the device supports the Significant Motion hardware trigger.

When present, this sensor allows the SDK to wake from a deep idle state only when the device actually moves, saving significant battery.