This time I’d like to publish a post written by Doug Sillars member of the AT&T Developer Program team, he asked me to publish it on my blog so here we are, great job Doug!
Nothing chases away users (or invites bad reviews!) like an app that is slow or drains battery life too quickly. New research from AT&T and University of Michigan offers insight into how applications can be modified to prevent these issues from occurring. Historically, wireless optimization best practices have focused on how to optimize content for smaller screens and slower processors. In this article, the researchers describe how mobile wireless networks are different than wired networks, and how simple changes to your app can work WITH the network to improve your application’s efficiency.
What is truly fascinating about this study is that developers are given a peek at network architecture and lower-level protocols that are usually hidden from them. The researchers describe in detail the connection latencies and state machines that exist in wireless networks, and how much longer these timeframes are than in traditional networks. The main takeaway for developers is that all connections open and close on the order of seconds (as compared to milliseconds in the wired web). These latencies make content downloads appear slow, and can drain the battery quickly.
The researchers point out that it is more efficient to utilize fewer connections to send more data per connection. For example: 5 connections of 1 KB each utilize 90 seconds of radio, while one 5 KB transfer uses 19 seconds (a 79% decrease in battery usage for the same amount of data!).
Each network connection causes a power drain to the battery, and can make your application appear slow to the end user. By sending more data per connection (and using fewer total connections), you can drastically improve your application’s performance. The researchers provide the example of a news application that downloads data on demand (e.g., images are downloaded when the user scrolls to them). They found that prefetching images (sending many files in anticipation of future use) can reduce power consumption by 15-18%. Since the images are downloaded in advance, they are available for display immediately, and your application appears faster. However, the researchers are quick to point out that prefetching data is a delicate balance, as downloading content that is never used also wastes the battery (and can cause your users to exceed their monthly data caps).
In the case of a popular music streaming service, periodic audience measurements were draining battery life, causing the app to use more than 40% of its power to transmit just 0.2% of its data. By lengthening the time between these measurements, it is possible to greatly reduce the battery drain, and allow users to listen to more music (and at the same time view more revenue-producing advertisements)!
AT&T has begun working with developers of popular applications (like Pandora and Facebook) to enthusiastic responses. The biggest response has been that the solutions to optimize wireless applications are straightforward and benefit both the developer and the end user!