Friday, 31 July 2015

Optimize Battery Life with This Useful App


Optimize Battery Life with This Useful App

Battery life is an important aspect of your smartphone, especially if you use it for more than just calls on the go. Since you’re on XDA, you probably do and want to get the most out of your battery. Now, you can’t magically expand its size but no matter how much its capacity is, you should make sure it’s not draining faster than it should be.
  CPU Spy Reloaded Pro- screenshot thumbnail     CPU Spy Reloaded Pro- screenshot thumbnail     CPU Spy Reloaded Pro- screenshot thumbnail     CPU Spy Reloaded Pro- screenshot thumbnail     CPU Spy Reloaded Pro- screenshot thumbnail     CPU Spy Reloaded Pro- screenshot thumbnail


Your phone’s processor runs at different frequencies when you’re using the device. The CPU frequency it runs at is chosen by the “governor” in a smart manner, usually based on current usage. In other words, your CPU will run at a high speed when you’re gaming, but at a much lower speed if you’re reading an eBook. Again, you can’t do much here assuming the governor is doing its job. What matters the most is what happens when you’re not using the device. In that scenario, battery drain would be ideally minimal as your CPU goes into a special state called “deep sleep”, which consumes a minimal amount of power.
Everything seems fine, then — at least ideally. However, applications can request wake locks which keep your device awake, and are later released as soon as possible. While this makes sense for (and is properly used in) many cases, some applications and developers tend to abuse it due to bugs, oversights or ignorance. If your device is heating when the screen’s off, or if your battery doesn’t last as long as it should, that’s probably the main culprit.
This is where CPU and wake lock monitors, such as CPU Spy Reloaded by XDA Forum Member royale1223, come into play. Inspired by classic apps that share the same goal, it boasts an up to date, material design along with the features you’d expect. You can view neatly graphed CPU state statistics along with the time and percentage of each, wake lock statistics as well as general information about your CPU, GPU and battery. You’ll need to be rooted to view wake lock statistics, but everything else can be used on unrooted devices as well.
CPU statistics come in two forms: a scrollable and zoomable bar chart, and a pie chart. Timers can be reset or restored, allowing you to monitor your device over a more precise period instead of seeing all statistics since startup.
But that’s not everything! Some planned features are the ability to reset timers automatically when the battery is full, resetting wake lock times and detecting big.LITTLE and HMP CPUs. The developer is also happy to listen to any suggestions you might have.
The XDA App Translators also deserve a mention for their help with translating this app to various languages. If you want to join their efforts, or if you’re a developer who needs help with translating your app, make sure to check their thread out.
CPU Spy Reloaded is free, free of ads and comes with minimal permissions. If you’d like to support the developer, you can buy the pro version to unlock the light theme. Head over to the CPU Spy Reloaded Forum Thread to get started!


How to use CPU Spy Reloaded


So, you have just rooted your new Android device and installed CPU Spy Reloaded on it. It looks all pretty and geeky and all but you have no idea how to use it. Right? Then this is the right place for you. Let me welcome you to the geeky world of CPU statistics.

CPU States

You flagship Android device is a monster. It’s more powerful than an average PC. That’s all great, so what’s the problem? It’s your battery, it’s no monster, not even close. The evolution of batteries is much slow when compared to the evolution of microchips.


What does that mean? It means that if your android device is running at its full power all the time, your precious battery charge will be gone in couple hours or less.
So what does device manufacturers do? How do we solve this? Here comes the significance of CPU States. They are just different speeds at which your device could run. For example, if your devices maximum speed is 2000MHz (2GHz), your devices’ CPU States might be 250MHz, 500MHz, 750MHz, 1000MHz, 1250MHz, 1500MHz, 1750MHz and 2000MHz of course.
screener_20150720(23_52_52)

So suppose you are scrolling through the apps in your phone. That doesn’t require much work. So you CPU will probably be using 250MHz or 500MHz state. Then you decided to play a video. That requires a bit more work, so your device will switch to 1000MHz or so. Now, if you are playing very sophisticated game or running a torrent, the CPU will have no choice but to run at 2000MHz, consuming more power.
screener_20150720(23_51_02)
All this switching is handled by a special program inbuilt into your device called CPU governor. The default governor for Android devices right now is “interactive”, which is excellent at saving power. There are many other governors available and you can install/enable them if you are rooted. CPU governors are a big topic. Maybe I’ll talk about it later, but right now all you need to know is that an ideal governor will save maximum power without affecting performance.

Deep Sleep

screener_20150720(23_52_16)
Then again, if you just powered of the screen, and left you phone alone, your CPU should go into a state called Deep Sleep. That means it’s nearly not using any power at all. This is really important because if your device is not attaining deep sleep properly, your battery will take a hard hit.
Who would do such a nasty thing right? Who would dare to disturb your device that’s sleeping so peacefully? Short answer – low quality or rogue apps.  How do they do it? Short answer- wake locks.

Wake locks

screener_20150720(23_51_28)

So, let’s say you have an email app. This app has to check the server now and then, maybe every 10 minutes for new mail. Right? Suppose your device is sleeping when this app have scheduled an email check. What would it do? It might be an important email. So it wakes up the device. But that’s not enough. The device shouldn’t go back to sleep while the app is downloading emails. So what would the app do now? It would acquire a thing called wake lock. This is something like a token. As long as the app holds this token, the device can’t go back to sleep. So, when the app is done checking emails, it will release the wake lock and the device will go back to sleep.
This is the correct way an app would function. So what if an app acquires a wake lock and forgets to release it? Or what if it’s waking up the device every 2 seconds? You already know the answer.
So now the real question. How do we detect these nasty apps? Here’s where CPU Spy Reloaded comes in.

CPU State Charts

screener_20150720(23_52_16) screener_20150720(23_52_52)
This screenshot was taken from my Galaxy S4. In the first chart, the pie chart, you can see that Deep Sleep takes up only 42.9 % of the whole time the since the device booted up. Same results are shown as a bar chart in the second screen. If you use your device normally for 1 – 2 days, even with occasional charging, deep sleep should be somewhere above 60 %. So something is definitely wrong. Let’s take a look at the wake lock stats and see what’s causing this.

Wake lock statistics

screener_20150720(23_51_28)
Let’s look at the top packages in this chart.

1. Google Play Services

This one is the top of the chart for a reason. Google Cloud Messaging. “Approximately 60 percent of apps in Google Play are said to be now using the service at a rate of 17 billion messages sent per day.” – zdnet.com. Basically, most of your instant messaging and social network apps are using this service to get messages and push notifications to your device. By pooling these network polls together Google Play Services save more battery than any of those battery saving you have currently installed on your phone.

2. Vine

I haven’t opened Vine in weeks now. I’m not that active on Vine either. There is no reason why it should acquire 3689 wake locks. I sometimes enjoy watching hilarious videos on Vine but they should optimize the app more. Uninstalled.

3, 4 and 7 – Facebook messenger, Facebook and Facebook lite

Combined, these apps take 3214 wake locks. This was a brilliant strategy from Facebook. Separating messenger from the main Facebook app gave them two apps with half battery usage instead of a single app that eats away a huge chunk of battery. An excellent way to avoid getting bashed for high battery usage. But still, they have improved a lot over the years. Once again, I haven’t opened these apps in days, these apps wouldn’t be using so much battery in M because of the Doze feature.

5. Android System

These are probably wake locks needed for critical system tasks. Don’t worry too much about them unless you are using custom ROMs/Kernels.

6. Chrome

Chrome is at 6 because I’ve been using it a lot.

Conclusion

Okay kids, that’s how we find out who the battery thief is. I hope you found this article and the app useful. If you have any doubts, please mention in the comments below. Have a nice day and do not let those nasty apps get away with your battery.

Download Link

OR

No comments:

Post a Comment