You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Run the application on a device or emulator with Android 12 or Android 13.
Tap the "Determine Position" button. If prompted, grant location permissions to the app.
Tap the "Start Tracking" button to start tracking your location.
Observe the logs in the console for location updates.
Expected results
After tapping the "Start Tracking" button, location updates should be logged in the console at intervals of 10 seconds, as specified by the intervalDuration setting:
final androidSettings =AndroidSettings(
intervalDuration:Duration(seconds:10),
);
Actual results
On Android 13 (API 33)
Location updates occur consistently at 10-second intervals, as specified by the intervalDuration setting:
This discrepancy suggests that the intervalDuration setting in the AndroidSettings is not being respected on Android 12, resulting in a default interval of 5 seconds instead of the configured 10 seconds.
The desired interval for active location updates.
If this value is null an interval duration of 5000ms is applied.
There is no mention in the documentation that intervalDuration has limitations or behaves differently on Android 12 or lower. The observed behavior on Android 12 (updates occurring at 5-second intervals regardless of the setting) appears inconsistent with the documented behavior.
Code sample
The full reproducible sample can be found in the repository linked below. The main code for reproducing the issue is located in the main.dart file:
Sets the desired interval of location updates. Location updates may arrive faster than this interval or slower than this interval (if the request is being throttled for example).
It does not seem something we can change. Try using a real device when testing. It may also be dependant on the desired accuracy. I'll close this issue for now. Feel free to reopen when needed.
Please check the following before submitting a new issue.
Please select affected platform(s)
Steps to reproduce
Expected results
After tapping the "Start Tracking" button, location updates should be logged in the console at intervals of 10 seconds, as specified by the intervalDuration setting:
Actual results
On Android 13 (API 33)
Location updates occur consistently at 10-second intervals, as specified by the intervalDuration setting:
On Android 12 (API 32)
Location updates occur at 5-second intervals, despite the intervalDuration being set to 10 seconds:
This discrepancy suggests that the intervalDuration setting in the AndroidSettings is not being respected on Android 12, resulting in a default interval of 5 seconds instead of the configured 10 seconds.
Additional information
According to the API documentation for
intervalDuration
:There is no mention in the documentation that
intervalDuration
has limitations or behaves differently on Android 12 or lower. The observed behavior on Android 12 (updates occurring at 5-second intervals regardless of the setting) appears inconsistent with the documented behavior.Code sample
The full reproducible sample can be found in the repository linked below. The main code for reproducing the issue is located in the main.dart file:
https://github.com/motucraft/issue_geolocator_intervel_duration/blob/master/lib/main.dart
To reproduce the issue, follow the steps outlined above.
Screenshots or video
No screenshots or videos are provided as the issue is fully described by the console logs and code sample above.
Version
13.0.2
Flutter Doctor output
Doctor output
The text was updated successfully, but these errors were encountered: