Monday 12 May 2014

Increase the Battery Life of your Android Phone

We all love a fancy android phone right? But the problem with all the phones is that since they do too much, they have a very short battery life. The problem has worsened with the arrival of apps like Google Now and Google Services which constantly ask your device for a location and keep it active all the time, even if your phone is locked away.

I am telling 4 ways in which you can increase the battery life, based on the level of hacking you have to do to get it done, please read the gotchas before proceeding. If you apply any particular step and find it useful, please share it in the comments. Would be happy to know the tricks are working.

Turning off useless syncs

Information

Google syncs your account information in the background and this increases data usage as well as eats your battery. Not all of the information is required to be synced in the background, you can turn off the non-essential syncs to gain battery life.

Steps

  1. Go to Settings > Accounts > Google
  2. Here you can see everything Google is keeping in sync burning your precious battery, turn off anything you are not using or do not require to be up to date

Gotchas

For example, for an average user, I think only Gmail, Calendar and Chrome matters the most, rest of the things like Google+, Google Photos, Google Playstand, Contacts, Music etc. can be turned off safely. Dont worry, they will get updated when you open those apps, its just that they won’t be running syncs in background.

Turning off Location services

Information

Google keeps a track of everywhere you go by something known as Location Services. It uses your WiFi and your mobile data connection to give you location based services, and it tracks your locations even if the mobile is asleep, giving google a step by step history of where have you been, how much you have travelled etc. To know how much Google knows about you, login to Google Location History and surprise yourselves. Apart from the privacy concerns, Location Services uses a lot of battery.

Steps

To turn off Location syncs, do the following steps:
  1. Go to Settings > Location
  2. Turn off Location access

Gotchas

The downside of disabling Location Services is that apps using Location access would not work now, Google Now would be crippled, apps like Facebook, Quizup etc. would not be able to get Location access. Please do not do this if you want to continue getting Location services in your apps at the expense of battery.

Installing Xposed Framework and revoking wake up permissions (requires root)

Information

Ok so this is a little complicated than the previous methods, and for this you will require a basic knowledge of how things work in Android.
 
When you lock the phone screen, Android goes into a sleep state, where it shuts off the processor to a very basic configuration required to just keep the phone on. Battery consumption in sleep state is almost minimal, but the problem is that, apps do not allow the phone to remain in the sleep state, and have a permission to wake up the phone - something known as a wakelock.

These wakelocks consume a lot of battery life, since they continue to eat mobile battery even when your mobile is asleep. So the solution is to disable all those wakelocks. Unfortunately, android does not simply allow you to do that, and for that you will have to root your phone to gain special permissions in order to do it.

Steps

Just google ‘how to root xxx’ where xxx = name of your device and you will get a step by step guide of how to root your phone.

Once it is rooted, follow the steps below:
  1. Download Xposed Installer
  2. Go to Installer > Install/Update and reboot your phone
  3. After the reboot, go to Xposed Installer > Downloads and search for Per App Hacking and install its latest version
  4. Once installed, go to Xposed Installer > Modules and enable the module
  5. Open the Per App Hacking module and search for Google Play Services and Google Search, tick the prevent wake lock option
What we are basically doing is that we are removing the ability of the apps to wake up your device. You can do this for all apps that you think are not required when your phone is in locked state. In normal usage, I think all apps except Instant Messaging, Email and Calendar apps can be turned off. This will save you a lot of battery.

Gotchas

Note that this method can void the warranty of your device and you have been warned. But you can safely restore the warranty by unrooting it, steps available by googling it.

Installing Cyanogenmod (requires a little hacking)

Information

Ok so this is the extreme step - installing another Operating System all together on your phone. This is for all those people who have been denied Kitkat update by their manufacturers and want to experience the fun of some android hacking.

When you buy a phone, your phone comes with some modified version of android. Depending upon the manufacturer (e.g. Samsung, HTC, Sony etc.) you may have a number of apps that are not required for the pure android experience the kind of given by Nexus devices. Even people with Nexus devices can install this for the level of customization offered by this OS.

Cyanogemod is an extension of Android Open Source Project (AOSP) and they are one the largest group of developers trying to bring the pure and latest android experience to the android community. There are many other operating systems available as per your device, but this is the most famous one and most widely used one with developer support.

Steps

You can follow the steps given on the official Cyanogenmod website on how to install cyanogenmod on your device.

Once installed, follow the below steps:
  1. Go to Settings > Privacy > Privacy Guard
  2. Click on Advanced at top right corner of the screen
  3. Select any app you want and disable the permissions: Keep Awake and Wake Up
  4. You can also remove other permissions like Location etc. based on your privacy concers
This method gives more flexibility than the Xposed framework as you can disable the individual permissions of the app that you think are not required for the normal functioning of the app. This also solves your privacy concerns.

Gotchas

Installing custom OS can void your warranty and can even brick your phone if not done carefully. That said, please proceed at your own risk. I will not be held responsible for anything that happens to your phone.

Also, installing a custom OS may stop some of the functions of the phone, please read very very carefully about the known issues before installing. Usually you can find the known issues on the developer pages.

Conclusion

Whoa!!!! That were a lot of steps. If you follow any steps and find the results interesting, or even have some better solutions, please share it in the comments.

The inspiration behind all this hacking was the announcement of Samsung that Kitkat won’t be coming to Samsung Galaxy S3. So I installed Cyanogenmod and kept discovering all this. Here is the screenshot of my battery life:


Previously I used to get to 50% in 13 hours with 2-3 hours of screen time. Now I can remain at 70% using the screen time since at the rest of the times, my device remains in the sleep mode and there is minimal battery consumption. Note that my wifi was on majority of the time and the phone was awake only when sceen was on. Proven results.

If you have any doubts, please feel free to comment. Happy Hacking !!!! Thanks a lot to Cyanogenmod community, XDA Developers Forum and Reddit.