4
Planned

Passive location listeners

I'd like to perform an action via passive location monitoring (i.e. the action is triggered with the new location when another application requests location). I believe this is possible via LocationManager.PASSIVE_PROVIDER.

2 replies

R

Hi! Unfortunately that's an action, not a context, so I don't believe it does what I was requesting? I was looking to trigger an action based on when my location changes, which requires detecting the state change. (And of course I don't want to poll my location with that action every N seconds just to detect this; that would prevent my phone from sleeping properly.)

Oh, sorry, should've explained better. You can use the action like this: https://www.youtube.com/watch?v=xjpbv365q2k

If you follow this you can then use the location in a profile condition.

Hope this helps!

R

Thanks for the reply, but I see your video suggests polling every 5 minutes, which I already addressed above: it is not good for allowing the phone to sleep. There should be *nothing* getting triggered when there are no passive location requests. Furthermore, every 5-minute accuracy is too low as well. I want to get passive updates _whenever_ a location is requested -- for example, some applications (such as maps when driving, GPS tools, etc.) receive updates as frequently as *every < 10 seconds*, and I'm looking to receive *all* of those updates.

Oh, I see what you mean now. Sorry for misunderstanding before. Indeed that's not possible at the moment. Will have to add, thanks!

R

Thank you!!

Hi! You can do this already with the Get Location v2 action :) Hope this helps!