Google don't allow watch location for longer period anymore?

52 Views Asked by At

I have an app in which I am tracking user location like Uber. It works fine in the foreground. But in the background it works only for few minutes. After that, it gets stop.

But it starts send location information when I open the app again.

It's been two days I was searching for a reason. Today I suddenly found this in the google docs

In an effort to reduce power consumption, Android 8.0 (API level 26) limits how frequently an app can retrieve the user's current location while the app is running in the background. Under these conditions, apps can receive location updates only a few times each hour.

It's mean that I can watch user location few times? How other apps are working like Uber

1

There are 1 best solutions below

1
On BEST ANSWER

It is meant that the app receives the location as long as the app is opened in the foreground (in active use). If the user decides to switch to another application or put his device in his pocket, the GPS tracking will stop to update permanently after few minutes to safe resources (power consumption). Now only a limited use is possible. A lower sampling rate per hour.

But if you start the application again or use the app active without few minutes of break it will be update consistently.

Hope you can now understand what they wanted to point out. Cheers :)