A Study on the Energy Consumption of Android App Development Approaches

Mobile devices have become ubiquitous in the recent years, but the complaints about energy consumption are almost universal. On Android, the developer can choose among several different approaches to develop an app. In this paper, we investigate the impact of some of the most popular development approaches on the energy consumption of Android apps. Our study uses a testbed of 33 different benchmarks and 3 applications on 5 different devices to compare the energy efficiency and performance of the most commonly used approaches to develop apps on Android: Java, JavaScript, and C/C++ (through the NDK tools). In our experiments, Javascript was more energy-efficient in 75% of all benchmarks, while their Java counterparts consume up to 36.27x more energy (median of 1.97x). On the other hand, both Java and C++ outperformed JavaScript in most of the benchmarks. Based on these results, four Java applications were re-engineered to use a combination of Java and either JavaScript or C/C++ functions. For one of the apps, the hybrid solution using Java and C++ spent 10x less time and almost 100x less energy than a pure Java solution. The results were not uniform, however. For another app, when we restructured its implementation so as to minimize cross-language method invocations, the hybrid solution using Java and C++ took 8% longer to execute and consumed 11% more energy than a hybrid solution using Java and JavaScript. Since most Android apps are written solely in Java, the results of this study indicate that leveraging a combination of approaches may lead to non-negligible improvements in energy-efficiency and performance.

[1]  Sharad Malik,et al.  Power analysis of embedded software: a first step towards software power minimization , 1994, IEEE Trans. Very Large Scale Integr. Syst..

[2]  Benjamin Livshits,et al.  JSMeter: Comparing the Behavior of JavaScript Benchmarks with Real Web Applications , 2010, WebApps.

[3]  João Paulo Fernandes,et al.  Haskell in Green Land: Analyzing the Energy Behavior of a Purely Functional Language , 2016, 2016 IEEE 23rd International Conference on Software Analysis, Evolution, and Reengineering (SANER).

[4]  Foutse Khomh,et al.  On the impact of sampling frequency on software energy measurements , 2015, PeerJ Prepr..

[5]  Abram Hindle Green mining: A methodology of relating software change to power consumption , 2012, 2012 9th IEEE Working Conference on Mining Software Repositories (MSR).

[6]  Andrea De Lucia,et al.  Software-based energy profiling of Android apps: Simple, efficient and reliable? , 2017, 2017 IEEE 24th International Conference on Software Analysis, Evolution and Reengineering (SANER).

[7]  Hanspeter Mössenböck,et al.  An efficient native function interface for Java , 2013, PPPJ.

[8]  Gustavo Pinto,et al.  A Comprehensive Study on the Energy Efficiency of Java’s Thread-Safe Collections , 2016, 2016 IEEE International Conference on Software Maintenance and Evolution (ICSME).

[9]  Ming Zhang,et al.  Where is the energy spent inside my app?: fine grained energy accounting on smartphones with Eprof , 2012, EuroSys '12.

[10]  Abram Hindle,et al.  GreenMiner: a hardware based mining software repositories software energy consumption framework , 2014, MSR 2014.

[11]  Abram Hindle,et al.  Energy Profiles of Java Collections Classes , 2016, 2016 IEEE/ACM 38th International Conference on Software Engineering (ICSE).

[12]  Carlo A. Furia,et al.  A Comparative Study of Programming Languages in Rosetta Code , 2014, 2015 IEEE/ACM 37th IEEE International Conference on Software Engineering.

[13]  Gabriele Bavota,et al.  Mining energy-greedy API usage patterns in Android apps: an empirical study , 2014, MSR 2014.

[14]  Uwe Aßmann,et al.  Comparing mobile applications' energy consumption , 2013, SAC '13.

[15]  Andre Charland,et al.  Mobile application development , 2011, Commun. ACM.

[16]  Gustavo Pinto,et al.  Understanding energy behaviors of thread management constructs , 2014, OOPSLA 2014.

[17]  Fernando Castor Filho,et al.  Native or Web? A Preliminary Study on the Energy Consumption of Android Development Models , 2016, 2016 IEEE 23rd International Conference on Software Analysis, Evolution, and Reengineering (SANER).

[18]  Courtenay T. Vaughan,et al.  Energy Delay Product , 2013 .

[19]  Ramesh Govindan,et al.  Calculating source line level energy information for Android applications , 2013, ISSTA.

[20]  Michael Cohen,et al.  Energy types , 2012, OOPSLA '12.

[21]  Algirdas Avizienis,et al.  Fault Tolerance by Design Diversity: Concepts and Experiments , 1984, Computer.

[22]  Lori L. Pollock,et al.  SEEDS: a software engineer's energy-optimization decision support framework , 2014, ICSE.

[23]  Jácome Cunha,et al.  Detecting Anomalous Energy Consumption in Android Applications , 2014, SBLP.

[24]  Falko Dressler,et al.  The accuracy of Android energy measurements for offloading computational expensive tasks: poster , 2016, MobiHoc.