Paul Krill
Editor at Large

What developers can do to extend smartphone battery life

news analysis
Nov 24, 20143 mins

Smarter app design combined with energy-usage monitors can keep apps from hogging battery life

Battery power consumption remains a lingering problem on smartphones — and is getting worse with the latest advances in the devices. But developers can take steps to tackle the issue.

Carriers and consumers realize the importance of battery life, said Rick Schwartz, senior product manager at Qualcomm Technologies, during the recent AnDevCon Android technical conference. “Recent surveys have shown it’s actually the No. 1 [issue] to consumers. It’s more important than screen quality” and other factors, he said.

Complicating the problem is a trend in which battery power increases have not kept pace with faster processors and a growing number of CPU cores. Also, displays are achieving higher resolution and getting bigger, while phones are running 24 hours a day. Thinner phones further complicate the issue. “Of course, the thinner the phone, the thinner the battery,” Schwartz said.

It’s hard to say how much battery preservation is about coding and testing, Schwartz said. Applications can have problems with the likes of radio usage because most developers do know how to see what is happening, he said. Simple solutions like closing connections or grouping of packets can help with power consumption, he said. “The amount of power consumed by the radio is significant.”

Application power consumption can be measured, Schwartz said. “One of the most popular ways to do that is using the Monsoon power meter.” However, Monsoon is a pricey approach, costing $770, he said. There are other free options, such as Qualcomm’s Trepn diagnostic tool, which can be used with the Eclipse IDE.

Inserting application states into code, meanwhile, can help identify the cause of power spikes, according to Schwartz. Application state markers are placed into code and tracked with software such as Trepn.

Most applications do no use system resources efficiently, according to one study, said Schwartz. The most common causes of power consumption issues include inefficient use of the cellular radio and Wi-Fi network, preventing the processor from going to sleep, keeping the display lit too long, and taking too many GPS location fixes. These small amounts of wasted power add up, Schwartz said.

He cited AT&T Resource Optimizer, also a free tool, as a mechanism for determining if an application uses the cellular radio efficiently. It also tests for file download problems, HTML issues, and peripheral usage, then recommends fixes. The Battery Historian tool in Android 5.0 Lollipop is useful for diagnostics too, Schwartz said.

Meanwhile, connecting less often to networks can increase power efficiency.

Continual streaming can be another issue with power consumption. Applications should use wake locks, which keep the screen from turning off, at minimum levels. Also, TCP sockets should be closed when no longer in use.

When it comes to which applications use excessive data or CPU cycles, Google’s search application has been a heavy consumer of power resources, Schwartz noted.

Paul Krill

Paul Krill is editor at large at InfoWorld. Paul has been covering computer technology as a news and feature reporter for more than 35 years, including 30 years at InfoWorld. He has specialized in coverage of software development tools and technologies since the 1990s, and he continues to lead InfoWorld’s news coverage of software development platforms including Java and .NET and programming languages including JavaScript, TypeScript, PHP, Python, Ruby, Rust, and Go. Long trusted as a reporter who prioritizes accuracy, integrity, and the best interests of readers, Paul is sought out by technology companies and industry organizations who want to reach InfoWorld’s audience of software developers and other information technology professionals. Paul has won a “Best Technology News Coverage” award from IDG.

More from this author