Not logged in.

Contribution Details

Type Master's Thesis
Scope Discipline-based scholarship
Title Context-Aware Transformations to Reduce Energy Consumption of Android Apps: Helping Developers Conserve Energy
Organization Unit
Authors
  • Philip Schaffner
Supervisors
  • Harald Gall
  • Jürgen Cito
Language
  • English
Institution University of Zurich
Faculty Faculty of Economics, Business Administration and Information Technology
Date 2016
Abstract Text Mobile multimedia devices such as smartphones and tablets have grown rapidly in importance and prevalence. Partly caused by the availability of an immense number of apps for every circumstance they have become very important or even indispensable for many aspects of our daily lives. One of the main restrictions of mobile devices is the dependency on a battery and therefore a limited uptime. Developers of mobile apps often face great complexity and little support when trying to maximize the utility of the available battery capacity for the end-user of the device. One of the reasons for this is the fact that the battery usage is often coupled to the quality of service of an app. Thus lowering the battery energy consumption will result in a reduced quality of service. Also, the utility a certain quality of service of an app provides to a user can depend on many parameters, such as the current charging state, remaining battery capacity or personal preferences of the user. In this thesis, we gathered known source code patterns which are notorious for excessive battery consumption. We present an approach which first enables developers to detect these patterns during the coding of an app by means of static code analysis. Then, the source code is modified using a customizable transformation to achieve a higher utility for the user by lowering the quality of service in specific circumstances, thus using the available energy to full capacity. As a proof of concept we implemented this approach in the form of the BAT plugin (Battery Aware Transformations) for IntelliJ IDEA/Android Studio which provides full functionality for two of these patterns. It allows detection of patterns, configuration and tailoring of a transformation to lower the energy consumption and modification of the source code by automatic application of this code transformation. We evaluated our approach and tooling by performing the transformations on an Android app with this tool and measured the energy consumption of the transformed app. This energy consumption profile was then compared to the profile of the original app and shows that the reduction in service quality resulted in a reduction in energy consumption of up to 30% for the app. This corresponds to 16% of the energy consumption of the entire device in our experiment.
Zusammenfassung Mobile Multimedia-Geräte wie Smartphones und Tablets haben in den letzten Jahren eine immer grössere Wichtigkeit und Verbreitung erfahren. Unter anderem durch die Verfügbarkeit einer immensen Anzahl von Apps für jede Lebenslage haben sie in vielen Bereichen unseres täglichen Lebens eine grosse Wichtigkeit übernommen und sind nicht mehr wegzudenken. Eine der Haupt-Einschränkungen von mobilen Geräten ist ihre Abhängigkeit von einer Batterie und damit eine beschränkte Laufzeit. Entwickler mobiler Apps sehen sich oft einer grossen Komplexität und wenig Unterstützung gegenüber wenn es darum geht, die vorhandene Batteriekapazität optimal in Nutzen für den Benutzer umzusetzen. Dies liegt unter anderem daran, dass der Batterieverbrauch oft and die Servicequalität einer App gebunden ist. Ihren Verbrauch zu senken, senkt darum auch ihre Servicequalität. Dazu kommt, dass der Nutzen eines bestimmten Service-Levels einer App für einen Benutzer von vielen Parametern wie aktuellem Ladestand oder Benutzer-Präferenzen abhängen kann. Wir haben in dieser Arbeit bekannte Source-Code-Muster zusammengetragen, die bekannt dafür sind, dass sie die Batterie über Gebühr beanspruchen. Wir stellen wir einen Ansatz vor, der es dem Entwickler erlaubt, solche Muster während dem Codieren einer App mit statischer Code-Analyse zu erkennen. Anschliessend wird der Source Code mit Hilfe einer automatischen und konfigurierbaren Transformation so modifizieren, dass die Service-Qualität unter bestimmten Umständen gesenkt wird und damit die Batterie-Kapazität besser ausgenutzt wird und einen höheren Nutzen erzielt. Als Proof of Concept haben wir diesen Ansatz in Form des BAT Plugins (Battery Aware Trans-formations) für IntelliJ IDEA/Android Studie implementiert, das die volle Funktionalität f¸r zwei wichtige Muster enthält. Es erlaubt Detektion von Mustern, Konfiguration und Anpassung einer Transformation zur Senkung des Stromverbrauchs anhand von Kontext-Parametern und eine automatische Umsetzung dieser Transformation in den Source Code. Zur Evaluierung unseres Ansatzes und des Tools haben wir eine Android App dieser Modifikation unterzogen, den Stromverbrauch der transformierten App gemessen und mit der originalen App verglichen. Der Vergleich zeigt, dass die Reduktion der Service-Qualität einen Rückgang des Stromverbrauchs von bis zu 30% für die App erzielen kann. Dies entspricht einem Rückgang von 16% für das Gerät als Ganzes in unserem Expermient.
PDF File Download
Export BibTeX