[Galaxy 3 Android Development] Ano59:
Let's write something about battery life. I'll put those infos in my previous post, which is linked by slumpolo.

First thing : Task killers are useless !! Well, they may have some use, but not as a memory freeing tool. I'd advise you to uninstall your current task killer if you got one. They may rather use your battery than help it. Here's why.

However, it's still handy to get an app that can kill other apps, because some apps don't work well. I strongly advise to download Watchdog to do so. This app controls which app is using CPU, and CPU drains battery. I'm using a 20% CPU threshold and I'm getting (almost) no alert with my (well-behaving) apps. This is to detect "worse" apps but you should use "Real time CPU" sometimes to seek apps that are not running and that still use some percents of CPU. Watchdog will never kill any app unless you do it manually or unless you use the blacklist, and will never notify for a foreground app.

Whitelist mode lets you ignore a particular app for notifications. Handy to ignore your Live wallpaper; which runs "background", uses much CPU...but only when you're on your home screen.

Blacklist (requires paid version of Watchdog, which I bought) lets you autokill an app if it goes above a special threshold while being in background. You should use it when you got an app which you like but which misbehaves in background. I'm using one of them, SuiConFo Lite (a french app), which is handy when I open it 30 secs, but useless when it drains CPU in the background after being closed. So I've put it in the blacklist with 5% special threshold ; I can open it, use it 30 secs, close it, it will use more than 5% CPU in background and Watchdog will close it quickly. :) If you don't want to pay for Watchdog, kill the app manually with Watchdog after using it.

Autostarts is a little paid app which requires root, it lets you prevent apps from starting at startup. If you use it, I advise you not to kill "yellow" apps, even if they look useless to you. You can prevent useless "white" apps from launching, especially if they use some CPU in background.

I'm using Swapper 2 (free ad-supported app) which is able to automate the swapon command. I got a linux-swap partition on my SD card and I use it as swap. However, no one knows if swap is really useful for Android, so I don't advise you to use this app or not. This is even not really related to battery.

In this topic, no one talked about getting a firewall. I think Android antiviruses are completely useless, but firewalls aren't at all. :) I know only one of them, Droid Wall (free app, requires root). They are useful for two reasons :

1) They prevent apps from using network unless you allowed them to do so. If one of your apps tries to send things over the network without warning you, it will simply not work with a firewall (but I doubt there are many such apps). If you got a limited data plan, this prevents some apps to ruin it (waaaay more useful !). ;)

2) You can use the app with a whitelist or a blacklist. I use the whitelist, which can prevent many network-based apps from working (and can make you lose much time before you think to this damn firewall :p ) but which lets only "useful" apps to send and receive data. This may increase battery life as many apps won't be able to use network unless you allow them to do so. Think to ad-supported apps, which won't show any ad unless they're on the whitelist. But don't forget that those apps live from ads, so put them on the whitelist if you want to help them (or buy the donate version, I often do that, so I get no ad by using a firewall while helping developers :) ).

The firmware I had was not provided with iptables, which is needed by the app. You can find here instructions about how to install iptables.

And don't forget to think to your firewall if you think one app is "bugged" because it isn't able to connect !! Using a firewall on Android is very nice but you often forget it while an app doesn't work. :) Unfortunately, Droid Wall doesn't have such an UI like Superuser permissions', I hope they will improve their nice app.

I strongly advise SetCPU too, a paid app which requires root. This app controls your CPU. It won't overclock your CPU !! People overclocking their CPU often use this app because it's able to control the CPU using battery temperature or other parameters, but this app only underclocks your CPU or set it to normal ! Well, it may accelerate it a bit in rare cases but you'll never notice it.

Our little Android can have only several CPU clockrates : 83,375 MHz, 166,750 MHz, 222,333 MHz, 333,500 MHz and 667,000 MHz. Under normal use, 333,500 MHz and 667,000 MHz provide good responsiveness, 222,333 MHz slows the device (not much, but it

is

noticeable), 166,750 MHz really slows the device and 83,375 MHz slows almost everything (you can use the device but it will lag a lot). We cannot overclock our device right now, we'd need a custom ROM to do so.

I'll share with you my own SetCPU profiles, you don't have to use the same and I didn't try them for a while :

-> (default settings, in "Main" tab) : 83 -> 667, conservative (don't use ondemand scaling on I5800/I5801) (I didn't change default settings. They apply when no profile matches).

-> Priority #10 : Charging/Full, 667 -> 667, performance (performance scaling makes the device run always at the highest CPU clockrate, so the engine is very responsive. This scaling is theoretically a bit better than "conservative 667 -> 667" so it's good if you don't care about the battery and want a race horse instead of a phone, nice to try things while charging your phone, when you've set the dev parameter Keep the screen on while charging in your Android's settings).

-> Priority #20 : Battery < 50%, 83 -> 333, conservative (probably the most useful profile with Screen Off ; when battery count (a bit bugged on our phones...) goes under 50%, the device is underclocked to 333,500 MHz, which doesn't change responsiveness much while improving battery life, you may even put this profile with Battery < 70~80% if you want to save more battery).

-> Priority #30 : Temp > 40,0°C, 83 -> 333, conservative (this is to lower CPU clockrate before the phone burns, however I have no idea about the heat resistance of our phone so I've put a very low value, 40°C).

-> Priority #40 : Battery < 20%, 83 -> 222, conservative (the battery starts to be low, we're underclocking further, some lag may appear).

-> Priority #50 : Temp > 44,0°C, 83 -> 222, conservative (heat increases, CPU is slowed down further).

-> Priority #60 : Battery < 10%, 83 -> 166, conservative (battery is very low, the phone is slowed down to save the last percents).

-> Priority #70 : Battery < 5%, 83 -> 83, powersave (battery state is critical so the phone is slowed down a lot, you can't use it well but you will have more time to plug it. Powersave scaling is like "performance" but makes the CPU run at the min. value instead of max. value).

-> Priority #80 : Screen Off, 83 -> 83, powersave (makes you almost unable to use your phone when the screen is off, but you don't care because...the screen is off ! However, the phone may be slow one or two seconds after you turn the screen back on if you got a live wallpaper, you'll maybe prefer something like 83 -> 166, conservative, even if it saves less battery).

-> Priority #100, Temp > 50°C, 83 -> 83, powersave, audible warning (we can't control phone's heat so we warn the user and slow down the CPU to the min. clockrate).

It's my own SetCPU profiles, don't hesitate to tinker and change them a bit, you're not overclocking your phone so you won't burn it by changing those values. :) SetCPU should autodetect values that I gave, if it doesn't, restart it, it will.

If you're using a replacement Launcher (like LauncherPro) and if you experience very fast battery drain, TouchWiz may be still running in the background (Watchdog may detect it, I saw it before installing Watchdog so I don't know), if it does, kill it and you battery life will go back to normal.

Thanks to those handy apps, I could install a live wallpaper (Thunderstorm) and still save battery life. I used my battery from 100% to 60% in one day, which included many hours when I used Wifi a lot (nonstop). I hope this may help you.