-
Notifications
You must be signed in to change notification settings - Fork 242
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Optimize Location Retrieval Frequency: Differentiate Foreground and Background Modes to Save Battery #1381
Comments
While in the foreground, initiate a Timer and call .getCurrentPosition. See the api docs for this method — one of the options you can provide to that method is |
@christocracy |
Why do you think that? It’s not true. |
While in the foreground, the energy draw of calling .getCurrentPosition pales in comparison to the energy drain of the screen being on. |
Ok i didn't know that. So the best way is : Foreground -> set timer to get current position (.getCurrentPosition) if it's right i'll implement that. |
@christocracy |
No. you don’t need to worry about this. |
@christocracy
Your Environment
flutter doctor
):Expected Behavior + Context
I integrated the lib into my application and it works well.
I retrieve the location in the foreground more often because I move a point on a map. The problem is that I do not save the location in db each time I retrieve it (I store it every 150m / 200m).
So when the application is in the background I also retrieve the location very often while I do not move a point on my map. So I retrieve these locations for nothing.
I would like to know if there is a way for the lib to retrieve more often in the foreground than in the background? This would drastically reduce battery consumption because my application is more often in the background than in the foreground.
The text was updated successfully, but these errors were encountered: