Category Archives: Enerlytics

How I Cut Google Play Music Energy Drain by 15% using Eprof

Our previous blog on the battery-draining tests of three popular music apps Pandora, Spotify, and Google Play Music showed that the Google Play Music app is more energy-efficient and battery-friendly than competing apps, in streaming music from the Internet.

sidebarReaders in Reddit asked what about the energy drain when playing Music stored locally on the device, a feature supported by several apps such as Google Play Music. Such a feature allows users to enjoy listening to preloaded music when there is no network connection, or play prepaid albums.
On the contrary, our testing results (shown in Figure 1) shows that playing music from local actually drains slightly more battery than streaming music from the Internet, for Google Play Music 6.1! The battery-drain test was the same as before (see sidebar for methodology).

Figure 1. Time to drain the entire battery

Solving the mystery using Eprof

To understand why playing local music drains unexpectedly high energy, we used the Eprof source-code-level energy diagnostic tool. Eprof accurately breaks down the total energy drain of an app run at the source-code-level, e.g., by each app method.

The app energy breakdown by component output of Eprof (Figure 2) shows that while playing music from local indeed incurs no network energy, the app process incurs 56% higher CPU energy than streaming music from the Internet (in light blue).

Figure 2. Energy breakdown
Table 1.Top energy-draining methods in Google Play Music 6.1 when playing local music

To find the root causes for the high CPU energy in playing local music, we next looked at the method-level energy breakdown of Eprof. Table 1 shows the top 10 (inclusive) energy draining methods during 1-minute local music playing in Google Play Music output by Eprof. We see that at top of the list are standard Android framework methods of class android.os.Handler and android.view.Choreographer, which perform generic message and callback handling for the app and will always be the top methods for most Android apps. What is interesting is that there are 3 methods of class among the top 10 (in blue), which indicates that the app spends a major chunk of energy in rendering animations.

However, there is no visible animation in the music player view we profiled, shown in the app screenshot in Figure 3(a). In fact, the only animations during music playing are the playing indicators in the album screen and play queue screen, circled in Figure 3(b) and 3(c). All three screens belong to the same activity and users can navigate between them with 1 or 2 clicks. Our observations suggest that Google Play Music spends a major chunk of the CPU energy on rendering animations that are invisible to users, which could be an “invisible animation UI energy bug”.

Figure 3: Screenshots of Google Play Music app

The impact of the energy bug

By hacking the app apk, we confirmed the energy bug is due to the app failing to consider the visibility of the play indicator animations, which results in a considerable amount of energy spent on animations that are invisible to users.

To confirm the bug’s impact on energy drain, we removed it by making the following 2 changes to the app:

  1. Adding code to check whether the play indicator is visible to user before starting its animation;
  2. Adding visibility change callback (i.e. onVisibilityChanged()) in the play indicator to handle its visibility change, i.e. start, stop its animation when it becomes visible, invisible, respectively.

We then repeated the battery drain test as before. The fix reduced the CPU energy of the Google Play Music process by 4.3X (Figure 2 in blue), and the total app energy drain by 15% (Figure 1).

Interestingly, after we learned the intricacies of the invisible animation energy bug in playing local music, we went back to the online streaming playing mode, and found the bug also exists in Google Play Music when streaming music from the Internet. The impact on energy drain is less, since there is only one invisible animation in play queue screen, as opposed to multiple invisible animation in both play queue screen and album screen when playing local music.

We have reported this issue to Google Play Music team.

Do you have an app?

user      No.

dev      Yes, I develop apps.

sales      Yes, I market apps.


Music Lovers: Switch Streaming Music Apps and Extend Your Battery Life by 2X

Since Pandora first launched music streaming 15 years ago, the music streaming category of mobile apps has become crowded with over a dozen popular alternatives today, many of which are undergoing rapid revisions. For example, Spotify releases a new version of its mobile app every two weeks. As a result, deciding on which music service to choose has become often difficult. In fact, a simple Google search for “Pandora vs. Spotify” today churns out over 4 million search results, which attempted direct comparisons of leading music streaming services along a multitude of dimensions, such as song selections, features, user experience, and business model.

Since battery drain is an important factor that affects user experience, we carried out a head-to-head comparison of the battery drain rate of 3 leading streaming music apps.

To isolate the impact of other apps running on the devices, we tested the battery draining rate of the recent versions of Pandora, Spotify and Google Play Music in the lab.

Screen Shot 2015-12-21 at 9.47.15 PM Our methodology for the test consists of three steps. In step 1, we measured the battery life in playing music in foreground and background, respectively. We uninstalled all the other third party apps from a Nexus 6 phone so that no other background task was running. We then put each of the three music apps in the streaming music mode to play music from a pre-selected music categories, under WiFi (see sidebar for details). We measured how long it takes to drain the entire battery for each app. The results are shown in the following graphs.




In Step 2, we measured how much time real users spend playing music in foreground and in background using their smartphones. The analytics from eStar Energy Saver of 15,000 Android users who have installed at least one of the three music apps above shows that 83% of the total music app usage is spent on playing music in the background. On average, users spend 10 minutes playing music in foreground and 49 minutes playing music in background per day.

Finally in Step 3, we calculated the expected battery life in playing music under typical user behavior, as the weighted average battery life of the above measured battery life when playing music in foreground and in background,  weighted by the percentage foreground (17%) and background (83%) playing time measured on the 15,000 Android phones.


The results, shown above, show that Google Play Music drains over 2X less battery compared to Spotify, and Pandora drains 70% less battery than Spotify. In other words, for a music fan who spends a lot of time playing music on her smartphone, switching from Spotify to Google Play Music can extend the battery life and hence listening time by 2X!

We plan to benchmark the battery performance of other streaming music apps and we also welcome streaming music app vendors to repeat these experiments on different handsets following the above simple methodology.

Should you upgrade from S4 to S5 this holiday season

Connected devices have become de facto holiday gifts with device activations significantly higher compared to an average day. And according to a recent survey, long battery life is the most desired trait consumers look for in a smartphone.

Naturally, with Samsung being the Android market leader, the following question arises — should a Galaxy S4 user upgrade to Galaxy S5 this holiday?Although Galaxy S5 has a 10% bigger battery than Galaxy S4, but it also has a slightly larger screen, a significantly higher resolution camera and more powerful CPU and GPU.

The following infographic compares the battery life of S4 with S5 by analysing anonymised data of 6,000 users collected by Estar over 2 months.

We assume a user is a gamer if the app that spends most time on the screen is a game. Similarly, if the top foreground app is a music app (messaging app) then the user is a music fan (messaging lover). Also, inactive users rarely turn the screen on (<5% of the total time phone is powered on) whereas active users keep the screen on for more than 20% of the total time.

An Inconvenient Truth about Mobile

How often do users charge their smartphones? Are mobile phones mobile enough to hold charge for a day? How does short battery life affect user behaviour and user experience?
We answer these questions via the following infographic generated by analysing data collected by Estar Battery Saver from 37k Android users across 100+ countries.

All the data logged by Estar Battery Saver app is strictly anonymised; we don’t collect any information that may identify individual users.

Breakdown of users using external battery backup is obtained from here.

Estar Battery Saver logs remaining battery percentage and phone charger connect/disconnect events; we use these event timings to generate charging and blackout related insights. The phone usage is defined as the ratio of screen-on time over wall-clock time.