The advancement of mobile technology hasn't just led to social distraction — it's also led to frustratingly rapid battery drain. While the phones of yesteryear were dull and basic, it was possible to go through a day or even two without the need to recharge. With an Android or iOS device? Not so much.

Until recently, it was often assumed by the general public that surface operations were to blame. Our games, cameras, maps and streaming videos are welcome and celebrated additions to our daily routines, but the sacrifice required by their bright animation is well known — use them for a few hours, and you’l inevitably be on the search for a charger.

Fortunately, in late March, a team of researchers from Purdue University and Microsoft found that Android app ad-serving — the process that connecting apps to digital ad networks — was responsible for up to 75% of app-related battery drain. More often than not, these processes were taking place within the free version of apps, from Angry Birds to the New York Times, as the ad-serving provides advertisers with valuable data from a swath of users seeking free entertainment. In short, advertisers cover the cost normally gathered from the app’s purchase.

According to Abhinav Pathak, the Purdue computer scientist who led the study, the purpose of the research was not so much to expose the underbelly of battery drain but to assist developers and users in addressing it. Here's some useful information any developer should know to keep battery drain in check.

The Basics

The implementation of ad-serving is made possible by Apple’s iAd and Google’s AdMob, in addition to some third-party entities. iAd, which has been installed in some 15 billion apps, was released in 2010 and offers a diverse range of targeting data — demographics, music and movie interests, application preferences and more. AdMob, which was acquired by Google in 2009 and also functions on iOS, can target much the same, with options like age, gender and location enabling advertisers to reach the most relevant audience.

To target, they send data — user location, display specifics, gender, age, etc. — to servers, which then send back ads. Then, the phone returns the data about users’ engagement with the advertisements themselves. This data is both equally draining and valuable — knowing, for example, how many clicks converted to downloads can have a significant effect on marketing, but adds a communicative step to the process that further drains the battery.

Complex as it seems, the implementation of AdMob and iAd requires little more than dropping an SDK into a line of code. For developers who rely upon ads for monetization, third-party SDKs can be installed on top of AdMob and iAD to send extra data to servers.

For example, when the data involves location, the phone’s GPS chipset is enabled — exacerbating the battery drain problem significantly. “On top of having information sent to Apple's servers, multiple extraneous calls are made to other ad-serving platforms for the sole purpose of sending relevant information about the user and receiving targeted ads for said user," explains Arthur Sabintsev, lead iOS developer at Shelby.tv.

Solving the Problem for Developers

Unfortunately for Android users and developers, solutions are not always readily available. As Pathak found, ad-serving SDKs are, at the moment, poorly-coded — they provide little to developers in terms of options in a somewhat all-or-nothing approach. “The problem with all of these ad packages is that the developer doesn't really have access to the code provided by the ad distributors,” Sabintsev explains. “We just drop the pre-written code in our project, add a couple lines of code to connect our app to these libraries, and voilà, apps are served to the end user.”

This leaves two options: Address the issues on the end of those who create the SDKs, or leave it to users. “The vast majority of ad-serving solutions provide SDKs to developers, because it's a common development paradigm and it minimizes the amount of work required on the part of the developer,” says Robi Ganguly, co-founder and CEO of SDK Apptentive. “The difference between SDKs is how the creator makes decisions about network access, frequency and data transmission.” Apptentive, he says, tries to minimize the number of calls between the phone and the network — and it avoids relying on GPS.

Additionally, explains Aaron Parecki, co-founder and CTO of location-implementation platform Geoloqi, “This is typically more of a problem on Android phones, where apps are permitted to run in the background longer and are less likely to be shut down by the operating system.”

Shutting down the ad-serving processes, when possible, is only a temporary solution for Android; these services will often relaunch themselves shortly thereafter. Conversely, on iPhones, the operating will shut down apps that sit idle in the background, save for location services, which can run in the background indefinitely.

Solving the Problem for Users

As the study’s intentions suggest, the better the ad servers, the less they drain batteries. Until improvements are made, there are some introductory steps users themselves can take to limit the drain, though the major overhaul will come on the end of iAd and AdMob:

Most simply, monitor the number of apps that are open and be sure to close the ones that aren’t actively in use. This will be particularly effective on iOS devices, as closed apps will stay closed, while Android apps may reboot in the background.

On Android devices, it may be required that users fully uninstall unused apps. This, Parecki says, is the only sure-fire way to limit battery drain.

When possible, seek out the paid version of your apps — which, more often than not, don’t include advertising. The difference between a one-time fee of 99 cents and a continually dead battery may be minimal.

Over time, Apple and Google will continue to offer more granular data and options in their system settings that enable you to activate and deactivate functions specific to different apps. Turning off GPS, for example, will disable the constant location detection so common to battery drain. In Android, simply adjust the Running Services in your Settings; in iOS, adjust Location Services in your Settings.

Apps like AdFree and NetSpector for Android devices will, in most cases, both hide and block ads, entirely preventing the back-end data sharing responsible for drainage. Unfortunately, this will require rooting the phone itself, and remains to be developed for iOS users.

Ultimately, in addressing the shortcomings of ad-serving on a higher level, the power to change remains in the hands of those developing SDKs, as well as in developing functionality that allows users more specificity in the background.

Image courtesy of iStockphoto, alengo, Image courtesy of iStockphoto, VCTStyle