Android: Does leaving GPS enabled affect my battery?

Image

I often help out and regularly read forums and articles about Tasker for Android. One of the things I come across often is people using Tasker profiles to enable/disable GPS when opening specific apps such as Maps, Navigation etc. Or when creating a task set in Tasker with the ‘Get Location’ action to get a fix on the current position.

So what are the negatives about leaving GPS disabled?

  1. If you leave it off, then you have to enable it before loading up any app which will use it such as Google Maps. If you don’t you’ll get a prompt asking you to enable it
  2. If you use Tasker to enable it when opening an app, GPS is not initialized before opening the app. So you’ll still get that annoying prompt
  3. Most location based services from Google such as Now cards etc use the new api which uses cell tower & WiFi locations to determine your location with good accuracy. So it’s only really third party apps which will use the GPS service in the background
  4. The phone will record the last GPS fix and will use this to make getting a new fix on satellites faster the next time the service is started. If you disable GPS you’re starting from a cold start and it may take longer to get a positive satellite fix.

Image
Don’t be fooled. The GPS service on your Android device is only being used when you see the icon in your notification bar, it’s not always running and draining your battery.

Whilst I can’t comment pre-Gingerbread (it’s been so long since I ran a <=Froyo I just can’t remember). However, Gingerbread and JellyBean have all been pretty good at only initializing the GPS process when requested by an app or the system. In effect, what this means is if you keep control of your applications that you know will ask for GPS and limit these then you shouldn’t see much GPS usage at all.

I have left GPS enabled for years, and I just maintain within each app whether I want it to have access to my location. So for Facebook & Twitter I have disabled the location services from within the apps themselves. I have 34 apps on my phone which utilise the ‘Precise location (GPS and network-based)’ permission, of which most are weather updates or Google Services which i know do not use GPS but instead the cell based api. Other apps like Endomondo I know uses GPS and I’m happy with that as it only uses it when the app is opened.

 
Tip: You can find apps permissions in ‘Settings-Applications’ and then clicking on the app and scrolling down on the app details page. You can also install an app from the Play Store called Permission Friendly Apps. This app scores your installed apps based on their permissions, it can even filter apps with a particular permission such as the ‘Precise location (GPS and network-based)’ permission.

So can you leave GPS enabled? Sure, as long as you are aware of what apps will utilise GPS and keep on top of their settings there is no harm in it. There may be the occasional usage that runs in the background. But in my experience it’s infrequent and only for a short period that it’s more hassle to disable and enable the setting than to just leave it open for use as required. I’ve not noticed a significant drain on battery so I always recommend just leaving it enabled.

Tasker – How to use AutoRemote to control or get information from another Android device

Over on the XDA Noob/Beginners guide to Tasker I was asked how it’s possible to create a profile which will control or return information from another device. For instance, I have some profiles which will allow me to see the battery level of my wife’s phone or react to things like when we are both at Home (such as my automated Christmas tree lights).

So how can I know if my wife is at home or what her battery level is without her having to tell me? There are several ways, one of which is to have Tasker on both phones and to configure a profile on Device B (my wife’s phone) which will send a text to Device A (my phone) with a pre-defined message, i.e. “Home” and for device A to watch for texts from that sender with just that word in it and react to it. This can lead to lots of texts back and forth, creates lots of texts in your messages app and can also cost if you’re in and out a lot and don’t have a large or unlimited text plan.

My preferred method is a more silent back-door approach using the excellent Tasker plugin AutoRemote. You can read the description on the Play Store for more info about this app, but in essence what it does is creates a personal Google url for your device. It then uses this to link other devices and you can send messages via this url directly to another phone which can then react on this message. This is completely silent and works in the background so is a more discreet.

So how to set it up?

First of all both devices which you want to use will require Tasker and AutoRemote to be installed (there is a free version of AR, however it is limited to the amount of characters in a message to 2). Once installed on both devices opening the app up will start the generation of your unique url which will begin with http://goo.gl/. Once you have both urls just click on the devices button within AR and then click the +. Now enter the part after goo.gl/ in the box and let it associate the 2 devices together (You’ll get options to name your devices to make it easier to identify later).

That’s pretty much it for AR, you can now create profiles in Tasker to react to or send messages to the secondary device.

Now to configure Tasker:

To fully utilise AR you need to have a profile setup on device A to send a message, and a profile on device B to run whatever task you need on receipt of the message. I’ll start with setting up a basic battery level checker. Device A being my main device & Device B being a secondary tablet/phone for which I want to find the battery level for. What this will do is send a message to Device B asking for the battery level, and once received back will display it in the notification bar of device A.

While I use the Pro version of AutoRemote and highly recommend purchasing it, I’ll use messages with just 2 characters which will work on the free version so you can test before purchasing it. I’ve used “ba” for battery, and “br” for battery response. But you can tailor these as you see fit.

1. Device A. Requesting the battery level. This is just the task, you can assign it to a widget or set it up to run every half hour or so in a profile. I leave that up to you.

  • Task Name: BatteryQuery
  • Task: Plugin – AutoRemote Message
    • Configure:
      • Device: DeviceB
      • Message: ba

2. Device B. Receives the message and sends one back with the battery level.

  • Context: State – Plugin – AutoRemote
    • Configure: Event Behaviour: checked
    • Message Filter: ba
  • Task: Plugin – AutoRemote Message
    • Configure:
      • Device: DeviceA
      • Message: br=:=%BATT

3. Device A. Gets the battery level back and puts it into a notification.

  • Context: State – Plugin – AutoRemote
    • Configure:
      • Event Behaviour: checked
      • Message Filter: br
  • Task1: Variable Set
    • Name: %DeviceBBatt
    • To: %arcomm
  • Task2: Alert – Notify
    • Title: Device B Battery Level
    • Text: %DeviceBBatt
    • Icon: Pick one, I’d suggest one that looks like a battery

And that’s essentially it. Now if you trigger the task from Device A you should get a response back within a few seconds.

If you have some knowledge on Tasker variables you can do all sorts like have Device A send a find command (“fi”) and have Device B raise all volumes and sound an alert. Even have it find the phone by getting Device B to use the Misc – Get Location task to establish a GPS fix and then send that as something like “lo=:=%LOC” back to device A. On receipt Device A could write the %arcomm to a user variable and then run the task Open Map in point mode to the Lat/Long of your newly created variable (if you do this, add a label in this task to get a precise location).

Other ideas are on the AutoRemote main page. Ones I use and like are turning your PC off at night (yep, There’s an AutoRemote program to enable you to control a PC as well). Open a specific app on a secondary phone when you leave the house, this starts the IPWebcam app on one of my old phones to be used as a home surveillance camera. The world really is your oyster.

You could even use the AutoVoice app as your context for the first task. So for instance you can press the AV shortcut on the homescreen and say “What is DeviceB’s battery level”… this could trigger the AR message to be sent…. it could even read it back to you using Tasker’s ‘Say’ task.

This is a very basic step by step of how to create a simple task. You can do a lot more using the AR variables and multiple parameters. A Good guide to these extra features can be found on the Pocketables.com site here.

What is Tasker for Android?

Image

I remember when I first started using Android, there was all this talk of automating what you can do on your phone using an app called Tasker. I was new to all this so it really intrigued me as previously I’d used Symbian and had time contexts to establish a silent mode at work… But that was about it automation wise. So what else did Tasker offer? Well I read a few reviews and decided I’d give it a shot.

For those of you who are not familiar with the app, here’s the header description from the Play Store:

“Total Automation, from settings to SMS. ADC2 finalist!

* Triggers: App, Time, Day, Location, Hard/Soft State, Event, Shortcut, Widget, Timer, Plugins
* Actions: 200+ built-in, plugin support
* Tasks: loops, variables, conditions
* Scenes: design your own screen overlays
* App Creation: create your own standalone apps to share or sell! (Android 2.3+)”

Basically speaking, you can act on any type of single or multiple contexts (triggers) such as your location, connection to WiFi or Bluetooth device, opening an app, time/day, email or text received etc… There are too many to list. Based on these triggers you can then create a task list of what you want your phone to do when this profile becomes active. A simple and popular example would be something like when at work (triggered by connection to a particular WiFi AP or using Tasker’s own location map service) then turn silent mode on and Bluetooth off. When exiting the work location re-enable sounds and turn BT on for connection to a car handsfree.

You can organise your profiles into projects, so I keep my main Home, Work Car etc on the first tab and have split things like notifiers, Alarm creators, Home Automation etc into their own projects. Here you can see my main project page:

Image

As you can see in green my ‘Work’ profile is enabled and I have expanded this view so you can see the contexts used (%Car is a user variable which will be covered in a later post, but is basically saying if I’m not in my car. The AutoLocation context is a plugin from the AutoApps range of plugins for Tasker from a developer called Joao. However Tasker has a built in function to create locations).

I then have enter tasks in a Task list titled “Work Mode” and exit tasks with the aptly named “Work Mode Off”. Here’s is my Work Mode task list:

Image

In effect what I’m saying is when I’m not in the car and I’m in the region of my work I want Silent Mode to be enabled, a user variable of %Work to be set to 1 (I can then use this to ensure tasks or profiles do not get triggered whilst at work i.e. a time based profile which would override my work profile) and finally the screen to remain on when charging (I put my phone in a dock).

This is quite a basic setup, but one that is very useful to have.

Tasker can be found from the Play Store. There is also a 7 day free trial version available direct from the Tasker website.

Further Reading: