[G1 Android Development] samaral:
I had seen one too many posts about people asking and complaining about battery drain issues on their G1 phones and it gets tiring to read it every 5-10 posts. So I decided to create this thinktank to pool in ideas from the community and create a set of best practices to maximize mileage of our phones. I'm currently using a HTC Dream with stock battery and my battery life is pretty good with light to medium usage. I would like to contribute to the community by creating this thinktank thread. I hope this can help as a guide for myself and for people who have been having numerous battery drain issues on 5.0.7-DS and variants of this distribution.

This is NOT the ultimate end-all solution for your battery problems. These are just steps to tackle the problem. If you want minimum to no battery drain keep it plugged to socket or plug it in a car battery.

If you would like to contribute your experience, or make any corrections please do not hesitate to post and I'll include them if they seem fit and attach your name as reference. I'll also do my best to give credit where credit is due. Please see the references at the bottom part of the post. Please do not clutter this thread by doing "I'll try this" or "It doesnt work" post. Its more important for all of us to know WHY it work/didnt work. Stick to topic, and be constructive. Be intelligent. Think first.

0. Update your Radio

Updating your G1's radio to the currently-latest version (2.22.23.02) should give you better battery life as well as signal reception (you can always switch back to 2.22.19.26I if it doesn't work out for you)

1. Recalibrate

Take note that

BATTERY STATS ARE WIPED

whenever you flash a new rom. (since full wipes are required whenever changing ROMS, and /data is where the battery info is.) This usually leads to inaccurate battery readings.

Here's how you recalibrate properly:

- Charge your phone till the GREEN LED shows up. Leave it for another hour.

- While plugged, go to recovery and wipe your battery stats.

- Right after the phone is booted up and settled, unplug and use as per normal till it shuts off. Then charge as per normal.

2. Disabling some basic phone hardware functionality

Turn off GPS, WIFI when not in use. And brightness set to manageable levels. Even loudspeaker. This is self-explanatory. Automation software like LOCALE can be useful, but usually all it takes for you to turn off your ringer, or turn on wifi when you're at a specific area is just a press on the Power control widget.

3. Overclocked kernels

Running on full overclock speed (by default is 528mhz or even higher on some kernels) will drain your battery faster and you'll notice significant heat increase when you're using your phone along with 3G.

Although im using pershoots 576mhz overclock kernel, I do not max it to 576 unless needed. The reason why I use his kernel is due to its UNDERVOLT capability. I have set up my phone using SetCPU

Usually I would set my phone to 384mhz if im going to stay on it longer (texting/long browsing etc). On the sleep mode I set it to 122mhz to 384mhz.

4. Tame your widgets, minimize using them.

Widgets that constantly connect to the internet, or constantly refreshing on the screen to update data being shown on the screen at extremely small intervals would also give you battery drain. Minimizing widgets can help minimize applications running in the background (free up memory) and avoiding your phone going on "partial sleep". Also tweak your widgets to update as less as manageably possible. If for some reason you can't see the next suggestion.

Aside from that you might want to disable Background syncing and do manual syncing. Aside from saving your data plan, it also saves battery life. You can disable it by doing the following:

manually update your facebook widget or contacts/gmail by

5. 3G, 2G, switch off, or automate it.

You'll notice that inside the default settings for mobile networks. Setting to 2G will "save battery" which is actually true. The connection will definitely be slower, but if you like your phone to last longer throughout the day, either switch to 2G or turn it off altogether.

Also, similar to juice defender, I use 2g/3g toggle and toggle data as and when needed.

Another suggestion that I just found out recently is the use of Juice Defender app [d]. It automatically turns on or off your APN settings at intervals. You might want to try to look at that app if you cannot do #4

6. Disable live wallpapers. Auto Updating Sense

Remember that 2.1 isnt actually built for our old phones. and livewallpapers do require cpu/gpu processes. These are also running in the background and may run while your phone is asleep. So turning them off will benefit you.

7. Refrain from using Automated task killers and choose what you kill.

If you see that the app you had been trying to kill a few times keeps coming back. Stop killing it. Everytime you do, and whenever it respawns, CPU flies to 100%. Go back to #4.

8. Disable Market notifications.

9. Make your phone sleep.

Open your spareparts application, Go to End button behavior. Select "Go to sleep"

10. Under the hood tweaks

10.1 Extending Wifi scan intervals

Edit the wifi scan interval in

/system/build.sapphire.prop

(or

build.trout.prop

if you have a G1)

Changing this number to just 90 second will half your wifi scans. Obviously larger numbers can mean less wifi scans which means more battery life, though it may take a little longer for your phone to pick up a remembered access point when in range. This is not just a CM/Eclair thing, it can also work for Donut phones.

This setting needs a reboot after editing the file. Edit it with Root Explorer, or nano as root if you have CM5, or pull the file with adb then edit it then push it back.

11. Remove your phone from your pocket whenever you can.

Body heat deteriorates battery life :) no kidding! there had been already studies to back it. I keep my phone either on my hand or outside of my pocket to keep it cool. Do whatever is manageable in your environment. If you're using your phone as a music player streaming using streamfurious and stuff. dont let your body heat add to the heat already been generated by your phone itself.

References / Updates :

[a] cyanogen recalibrating batteries : http://wiki.cyanogenmod.com/index.php/Troubleshooting#Battery_recalibration

thanks to mejorguille for correction on /data and wiping.

pershoot UV kernel: http://xdaforums.com/showthread.php?t=666850

[c] SetCPU main site : http://www.pokedev.com/setcpu/ - Thanks also to ShadowCH for tip.

[d] JuiceDefender : http://www.latedroid.com/2010/01/juicedefender.html -

- Thanks to shohid1234 for 3G-2G toggle

[e] Thanks to Jaymzz for tip on disabling market: http://forum.cyanogenmod.com/index.php?/topic/94-i-fixed-my-battery-drain/

[06/02] thanks to Arkain2k for tip #0

[06/04] Thanks to Foo_Blyat's tip for disabling background sync and manual updates for fb/gmail (item 4) http://xdaforums.com/showpost.php?p=6670907&postcount=36

[06/04] Thanks to Super Jamie for tip 10.1 extending wifi scans http://xdaforums.com/showpost.php?p=6684954&postcount=49