HTTP Adaptive Streaming (HAS) is becoming the de-facto standard for video streaming services over the Internet. In HAS, each video is segmented and stored in different qualities. Rate adaptation heuristics, deployed at the client, allow the most appropriate quality level to be dynamically requested based on the current network conditions, in order to achieve a continuous playout. Due to the ability of HAS protocols to dynamically adapt to bandwidth fluctuations, they are especially suited for the delivery of multimedia content in mobile environments. However, current HAS solutions do not take the battery lifetime into account, which is a typical issue for mobile devices. In this paper, we therefore propose an energy-aware heuristic for HAS. We first present a measurement study to identify and quantify the main factors influencing the battery lifetime on mobile devices. We then develop a heuristic based on these findings, which optimizes both the quality of experience and the battery consumption of a video streaming session. Particularly, we found that the video resolution and display size have the highest impact on the battery lifetime and that our energy-aware heuristic can prolong a streaming session with up to 13%, compared to a standard HAS heuristic. This result represents a consistent improvement for the overall user experience on battery-constrained devices.