minimumActivityRecognitionConfidence property
The minimum motion-activity confidence to conclude a device is moving.
Defaults to 75%. Each activity-recognition-result returned by the API is tagged with a "confidence" level expressed as a %. You can set your desired confidence to trigger a BackgroundGeolocation.onMotionChange event.
This setting can be helpful for poor quality Android devices missing crucial motion sensors (accelerometer, gyroscope, magnetometer) by adjusting the confidence lower.
Example
import 'package:flutter_background_geolocation/flutter_background_geolocation.dart' as bg;
await bg.BackgroundGeolocation.ready(bg.Config(
activity: bg.ActivityConfig(
minimumActivityRecognitionConfidence: 50, // <-- trigger less confidently.
),
));
Implementation
final int? minimumActivityRecognitionConfidence;