With power demands of mobile devices rising, it is becoming increasinglyA�important to make mobile software applications more energy efficient.A�Unfortunately, mobile platforms are diverse and very complex which makesA�energy behaviours difficult to model. This complexity presents challenges to theA�effectiveness of off-line optimisation of mobile applications. In this paper, weA�demonstrate that it is possible to automatically optimise an application for energyA�on a mobile device by evaluating energy consumption “in-vivo”. In contrast toA�previous work, we use only the device’s own internal meter. Our approachA�involves many technical challenges but represents a realistic path toward learningA�hardware specific energy models for program code features.