What developers can do to extend smartphone 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.