Twitter Updates

Wednesday, July 28, 2010

Sorting out your Android Battery Life

I love Android. It's a real operating system, that lets you do proper multitasking, and has a ferocious pace of innovation from both Google and the development community.

It can be tough to keep the battery life up on most Smartphones. With Android, it's tougher. True multitasking means that it's possible for rogue apps to stay active in the background. Android exposes APIs for virtually everything in the phone, including the PowerManager to allow apps to wake it up.
In addition, when you first get your Android phone, you'll install tons of programs, set the update frequency to the max, and soon be very frustrated at your battery life.
This article documents some of the steps, techniques and apps that I've used to increase my battery life.
1. Know what's going on

You'll need to know how fast your battery is draining, and when it's doing so. Install a battery graph. I've used two:
  • Battery Graph
  • Simple, does what it says on the tin, easy to read, doesn't drain the battery itself, and can be "always on".

  • JuicePlotter
    JuicePlotter has more information than Battery Graph, including radio state and battery temperature. This gives you a couple of more factors to look at when determining the usage. The big advantage of JuicePlotter, however, is that it has a widget which predicts how long your battery is going to last. This is really useful.
This will give you a basic idea of the rate of drain of your battery, and the times when it increases. You may be able to map this to what you're doing at the time, and what programs you're running.

2. Understanding Awake Time
Android is pretty clever, and tries to minimise battery use, but putting the phone to sleep, except for essential processes as much as possible. When it manages this, nothing's running except the operating system and radio.
You can check your awake time by going to Settings > About > Battery. You'll see two numbers: Uptime and Awake time. Uptime is the time since last boot, Awake time is time when the phone is active. If this is high, this is definitely the place to concentrate your efforts. You want this to be as low as possible - I aim for 20%.
3. Using Android's built in Battery Use Monitoring
In 2.1, if you click on Battery Use in this screen, it'll tell you what has used the most battery since the last boot. Expect to see Display, Wifi, Cell Standby, Phone idle and the Android system in here. If you see programs that you haven't been interactively using recently, they may be causing you problems, and you should try killing them (Using Advanced Task Killer, for example) to see if your battery usage decreases.
4. Use a Task Killer?
Google advises against task killers as a way to run your Android, and I agree with them. I have Advanced Task Killer to deal with extraordinary situations, but in general, I let Android deal with closing and destroying apps. It does it well, and you'll find your phone runs faster if you leave it to it. See Component Lifecycles in this page of the Android Developer Guide if you don't believe me.
What you might use a task killer for, though, is looking for programs that you haven't used in a while, or may not have used since you started the phone, that you wouldn't expect to still be running. I found a couple that seemed to always start up a while after I booted the phone, and stay there. I got rid of them.
5. Minimise Syncs
This is the big one. You've got a great smartphone, you want to now always be 100% up to date. You're installing multiple Facebook, Myspace and Twitter apps, because you don't know which one you like best, etc.
The problem is, that these apps probably don't respect the phone's sleeping, and will wake the phone up to sync on your schedule. How do you deal with this? 2 ways:
a. Sort out Android's own Syncing:
This depends on the version of Android you have; I'm working off 2.1, but I know it was different in 1.5. In any case, it's fairly self-explanatory. Go to Settings> Accounts and Sync. Anything you don't use (Weather? Come on, you have another Weather app...), disable syncing. Actually - even if you do use weather, do you need it constantly synced on your home screen, or just when you want it?
You may have other options in here, on my HTC Hero I have Facebook, Flickr and Stocks. I've disabled HTC's Facebook sync (I use a different Facebook app) and set everything else to the least frequent sync option.
Unfortunately, under 2.1 the option to tune how often Google Mail, Calendar and Contacts syncing happens seems to have disappeared. Still, if you don't use (e.g.) Google Calendar, disable it.
b. Look for other Syncing Applications
Have a think about all the apps you've installed. Look particularly at news, social networking, sports scores, RSS, etc. apps. Most will have their own preferences controlling syncing. What turned out to be killing me more than anything else was Bloo, a Facebook client, syncing my feed every 2 minutes! This is the default for that application. What that means is that every 2 minutes you are waking up the phone, turning on radio, connecting to 3G, opening a socket, downloading (probably nothing), and then waiting for the phone to tear all that down again. Make 15 minutes your minimum sync period for any app.

6. Widgets, Live Wallpapers, Cool stuff
I love widgets. I think they're one of the key advantages that Android has over the iPhone. I never got them on PCs, but on a mobile phone they're essential. I've customised my seven homescreens to death (and I need more!). Unfortunately, some of these come at a cost. Make sure to check any new widgets for auto update frequencies, and tune them to a reasonable level. Again - ideally you want them to just do stuff when you want them to, and if they have an update frequency, dial it down to 15 minutes or more.
7. Location Services
GPS is a significant battery drain, but fortunately it's usually only on when applications are using it. If you see the GPS signal on the task bar a lot, you may have an application that's doing background location updates. You may wish to disable this, or set those apps to only use Wireless location services, rather than GPS. You can, of course, get a widget to disable GPS, so that you can only turn it on when you want.
8. Y5 Battery Saver

Y5 is the best way of managing your Wifi. It remembers when you've connected to a wireless network, and what phone towers you were near at the time. It then turns on wireless when you're back in range, and turns it off when you're out of range. This is an excellent utility, as leaving wifi on and scanning all the time is a horrendous drain.
9. Install a Power Manager

I'm not sure why I put this last. It should probably be first - call it lack of editing. There are two power managers that I'm aware of.
  • Power Manager
    Just install this, use its defaults, and it will save battery. You can, of course customise all the profiles, and you'll probably find that you want to change some of them, but the defaults it comes with are very effective.
  • Juice Defender
    I haven't used this yet, but am planning to. This allows you to customise even more, including allowing you to enable radio every X, enable synchronisation every Y minutes. If you want to get even more life out of your phone, this will give you the control you need.

9's a pretty silly number for a list, isn't it? I couldn't think of a 10. Feel free to make your own suggestions in the comments. I've noticed that I've put some of the easiest things last, and this is because I was describing the process as I did it. Think of 5-9 as actions you should definitely do, and 1-4 as things you might want to look at to get more information, and monitor how you're doing.

Tuesday, July 27, 2010

Google Places vs Aloqa

Google Maps was upgraded today. You can read about it here. They've added a new "Places" functionality, that looks very like Aloqa, which I've been using occasionally for a while. When I upgraded Maps, I was interested to see how it would stack up (and whether I still needed Aloqa).

I did some tests from my flat in Limehouse. When I looked for Bars and Restaurants, Google came out with some good suggestions, ranking The Narrow highly, which would be my favourite bar and restaurant in the local area.

However, it is basically a set of saved Google Searches, that search Google's places data structure, and is therefore at the mercy of those data. The shortcomings became very evident when I looked at some of Aloqa's more editorial categories, such as Music. It came back with suggestions about what's on around me, where, and what time. It included small pub nights (like Jazz in the local) and more established artists.

More surprisingly, is that Google's ATM search (included by default) was rubbish. It suggested my nearest ATM was in Moorgate. Aloqa correctly pinpointed the nearest ATM to be that at Tesco Limehouse, and included all the third-party cash machines in the area, and identified them as being charging. (It seemed to have a right-shifted decimal point in the charges, though, suggesting that they would charge an eye-watering £18 per transaction).

I've decided that there's room for both on my phone, and I like the new interface Google's given to data that it already had. However, as a result of performing this comparison, I think I'll find myself using Aloqa a lot more than I used to.