Better way to check which location service is enabled?

15 views
Skip to first unread message

tboooe

unread,
Oct 18, 2017, 4:11:35 PM10/18/17
to Tasker
Its been a few years since I last used Tasker.  

I want to check to see which location service is enabled (network or GPS).  I know I can run in Tasker the shell command "settings get secure location_providers_allowed" and get back either get "network", "gps", or nothing.  I can then do a matching for "network" or "gps".  So my question..is there a simpler way to do this with perhaps a built in Tasker function?

Sean Williams

unread,
Oct 18, 2017, 5:43:23 PM10/18/17
to Tasker
Hi,

I want to check to see which location service is enabled (network or GPS). I know I can run in Tasker the shell command "settings get secure location_providers_allowed" and get back either get "network", "gps", or nothing. I can then do a matching for "network" or "gps". So my question..is there a simpler way to do this with perhaps a built in Tasker function?


You have of course the global %GPS variable.

If you want the exact mode the only way I know of is to query with Taskers java actions.

tboooe

unread,
Oct 18, 2017, 6:16:23 PM10/18/17
to Tasker


On Wednesday, October 18, 2017 at 2:43:23 PM UTC-7, Sean Williams wrote:

You have of course the global %GPS variable.

If you want the exact mode the only way I know of is to query with Taskers java actions.


Thank you...thats what I figured.  I will go ahead with the adb shell command method I outlined in the first post. 
Reply all
Reply to author
Forward
0 new messages