android - Setting priority as PRIORITY_HIGH_ACCURACY in the LocationRequest keeps GPS on indefinitely -


i using googleapiclient track user location every 30 secs inside service, want accurate location points app depends on used priority_high_accuracy, setting keeps gps on entire duration of service, gps icon goes away after call removelocationupdates explicitly.

i want following; in onlocationchanged callback location , send server , put gps sleep until next 30 secs elapse (i think might able save battery during period) not see way in reasonable way there no callbacks provided in locationrequest class.

am missing here or how api designed?

this setting keeps gps on entire duration of service, gps icon goes away after call removelocationupdates explicitly.

that behavior implementers of play services.

i think might able save battery during period

the google engineers responsible portion of play services apparently disagree. example, takes while gps start receiving fixes, waits receive signals satellites. perhaps google engineers decided that, setinterval(30000) (my interpretation of "every 30 secs"), did not make sense release gps radio , re-acquire it.

note play services takes accelerometer account. hence, behavior see may change if device left alone while.

also note play services handling location requests many apps, not yours. perhaps of google's decision-making based around other requests other apps, other priorities (e.g., priority_no_power).

is how api designed?

yes.

if not google's decision-making here, feel free use locationmanager instead of play services.


Comments

Popular posts from this blog

php - Wordpress website dashboard page or post editor content is not showing but front end data is showing properly -

How to get the ip address of VM and use it to configure SSH connection dynamically in Ansible -

javascript - Get parameter of GET request -