`disableStopDetection` not working on Android device
Closed this issue · 5 comments
Your Environment
- Plugin version: 1.8.0
- Platform: Android
- OS version: 6.0.1
- Device manufacturer / model: Samsung SM-G800F
- Nativescript version (
tns info
):
┌──────────────────┬─────────────────┬────────────────┬──────────────────┐
│ Component │ Current version │ Latest version │ Information │
│ nativescript │ 3.4.2 │ 4.0.0 │ Update available │
│ tns-core-modules │ 3.4.1 │ 4.0.0 │ Update available │
│ tns-android │ 3.4.1 │ 4.0.1 │ Update available │
│ tns-ios │ 3.4.1 │ 4.0.1 │ Update available │
└──────────────────┴─────────────────┴────────────────┴──────────────────┘
- Plugin config
{
"isMoving": true,
"enabled": false,
"odometer": 9188.639,
"schedulerEnabled": false,
"trackingMode": "location",
"distanceFilter": 10,
"desiredAccuracy": 0,
"desiredOdometerAccuracy": 100,
"locationUpdateInterval": 3000,
"fastestLocationUpdateInterval": 3000,
"locationTimeout": 60,
"deferTime": 0,
"disableElasticity": false,
"elasticityMultiplier": 1,
"allowIdenticalLocations": false,
"activityRecognitionInterval": 50000,
"minimumActivityRecognitionConfidence": 75,
"triggerActivities": "in_vehicle, on_bicycle, on_foot, running, walking",
"disableStopDetection": true,
"stationaryRadius": 25,
"stopTimeout": 120,
"stopOnStationary": false,
"url": ***REMOVED***,
"method": "POST",
"autoSync": false,
"autoSyncThreshold": 0,
"batchSync": true,
"maxBatchSize": -1,
"params": {},
"headers": {},
"extras": {
"device": {
"platform": "Android",
"manufacturer": "samsung",
"model": "SM-G800F",
"version": "6.0.1",
"uuid": "a975e073b18d193f",
"appVersion": "3.0.4"
},
"journeyID": "058dfac9-ef82-4498-9ef4-d40a4e4a5518",
"vehicleID": 454
},
"httpRootProperty": "location",
"locationTemplate": "",
"geofenceTemplate": "",
"persist": true,
"maxDaysToPersist": 365,
"maxRecordsToPersist": -1,
"locationsOrderDirection": "ASC",
"httpTimeout": 60000,
"geofenceProximityRadius": 1000,
"geofenceInitialTriggerEntry": true,
"stopOnTerminate": false,
"startOnBoot": true,
"heartbeatInterval": 60,
"foregroundService": true,
"notificationPriority": 0,
"notificationTitle": "",
"notificationText": "Location Service activated",
"notificationColor": "",
"notificationIcon": "",
"notificationSmallIcon": "",
"notificationLargeIcon": "",
"forceReloadOnLocationChange": false,
"forceReloadOnMotionChange": false,
"forceReloadOnGeofence": false,
"forceReloadOnBoot": false,
"forceReloadOnHeartbeat": false,
"forceReloadOnSchedule": false,
"stopAfterElapsedMinutes": 0,
"schedule": [],
"configureUrl": "",
"configureInterval": -1,
"debug": false,
"logLevel": 5,
"logMaxDays": 2
}
Expected Behavior
Device should continue monitoring GPS when the vehicle stops moving or location reporting should resume immediately after moving off. This works fine on iOS and seems to work on a number of other Android devices.
Actual Behavior
The device seems to wait for a significant change event after being stationary for small amount of time. This leaves large gaps in data.
Steps to Reproduce
Drive some distance.
Stop for around 5 mins.
Continue journey.
Debug logs
Stop one
https://gist.github.com/3rror404/2d502529d236cc2de2479c3e44cecfee
Stop two
https://gist.github.com/3rror404/1b84e5245f8a2779cd07d1d4bfb799dd
Any thoughts on this Chris? I'm getting a lot of pressure from one of my clients.
I have a Samsung SM-J500FN also running 6.0.1 that does not seem to suffer from this problem.
There's a wide range of quality between different Android devices. There's nothing unusual in the logs other than long periods where the Motion API reports the device is still
.
The plugin has location-services on. The device is not reporting any locations.
ℹ️ Location availability: true
04-16 17:00:36.976 DEBUG [BackgroundGeolocationService onActivityRecognitionResult] on_bicycle (70%)
04-16 17:00:36.997 DEBUG [BackgroundGeolocation isMainActivityActive] YES
04-16 17:01:07.351 DEBUG [BackgroundGeolocationService onActivityRecognitionResult] still (25%)
04-16 17:01:07.422 DEBUG [BackgroundGeolocation isMainActivityActive] YES
04-16 17:01:11.013 DEBUG [BackgroundGeolocationService onActivityRecognitionResult] still (73%)
04-16 17:01:11.037 DEBUG [BackgroundGeolocation isMainActivityActive] YES
04-16 17:01:15.057 DEBUG [BackgroundGeolocationService onActivityRecognitionResult] still (40%)
04-16 17:01:15.078 DEBUG [BackgroundGeolocation isMainActivityActive] YES
04-16 17:01:27.609 DEBUG [BackgroundGeolocationService onActivityRecognitionResult] still (21%)
04-16 17:01:27.631 DEBUG [BackgroundGeolocation isMainActivityActive] YES
04-16 17:01:32.012 DEBUG [BackgroundGeolocationService onActivityRecognitionResult] still (51%)
04-16 17:01:32.040 DEBUG [BackgroundGeolocation isMainActivityActive] YES
04-16 17:01:45.203 DEBUG [BackgroundGeolocationService onActivityRecognitionResult] still (22%)
04-16 17:01:45.231 DEBUG [BackgroundGeolocation isMainActivityActive] YES
04-16 17:01:49.871 DEBUG [BackgroundGeolocationService onActivityRecognitionResult] still (33%)
04-16 17:01:49.899 DEBUG [BackgroundGeolocation isMainActivityActive] YES
04-16 17:02:44.576 DEBUG [BackgroundGeolocationService onActivityRecognitionResult] still (49%)
04-16 17:02:44.604 DEBUG [BackgroundGeolocation isMainActivityActive] YES
04-16 17:03:14.736 DEBUG [BackgroundGeolocationService onActivityRecognitionResult] still (40%)
04-16 17:03:14.765 DEBUG [BackgroundGeolocation isMainActivityActive] YES
04-16 17:03:44.917 DEBUG [BackgroundGeolocationService onActivityRecognitionResult] still (72%)
04-16 17:03:44.940 DEBUG [BackgroundGeolocation isMainActivityActive] YES
04-16 17:04:15.112 DEBUG [BackgroundGeolocationService onActivityRecognitionResult] still (48%)
04-16 17:04:15.144 DEBUG [BackgroundGeolocation isMainActivityActive] YES
04-16 17:05:56.020 DEBUG [BackgroundGeolocationService onActivityRecognitionResult] still (22%)
04-16 17:05:56.069 DEBUG [BackgroundGeolocation isMainActivityActive] YES
04-16 17:08:18.606 DEBUG [LocationService onLocation]
What is the result of BackgroundGeolocation#getSensors
for that device?
All seems good on the sensor front...
{
"platform" : "android",
"accelerometer: true,
"magnetometer": true,
"gyroscope": true,
"significant_motion": true
}
The device that works well only has an accelerometer. Not sure if that tells you anything?
There's no explanation for the gaps. The plugin did not turn off location services during those periods. The device simply failed to provide locations during those periods.
1.9.0-beta.3
released. Be sure to do this