Abstract
Launch delay has been an important factor affecting users' experiences in mobile applications. To launch applications quickly, modern mobile systems such as Android often employ mechanisms such as LRU-based activity stack to keep inactive applications in the background. Whenever the user wants to run and interact with a background application again, that application can be switched back into the foreground immediately from the activity stack without delay in initializing the applications anew. Since background applications still consume the battery power of the smart phone, the challenge is to effect a balance between application launch delay and battery lifetime. The challenge entails two aspects. First, it is necessary to understand the power consumption and launch delay of mobile applications. Although it is not difficult to estimate the execution time of applications, their power consumption is hard to measure. In this thesis, we introduce two tools for measuring the power consumption of applications. The first is an offline power analysis tool called {\em ANEPROF}, and the second is an online energy model called {\em Energy Hunter}. Both offer systematic and formalized approaches for power estimation. ANEPROF is a measurement-based power analyzer which can obtain function-level power distribution and distinguish the power consumptions of threads, Java methods, and JVM services. We apply ANEPROF to provide the power consumption of default Android applications through a series of static measurement. Energy Hunter is a model-based power estimator which can track the energy footprint of individual Android applications down to the hardware components. We adopt Energy Hunter to offer runtime system power and the power consumption of third-party applications running on the system. Given information of the power consumption and launch delay of applications, the second aspect is to manage the applications to balance the power consumption and launch delay of the whole system. Current Android implementation examines only those applications that are already in the activity stack, which limits the amount of tradeoffs that can be made. If it is possible to predict what applications to be used in the near future, then the activity stack can be better managed to optimize the tradeoff of power consumption and launch delay. In this thesis, we propose an innovative application management strategy that terminates "unfavorable" background applications to save energy and pre-launch "favorable" applications to improve the application launch delay. The core of the strategy is a context-aware prediction scheme that predicts what applications will be used next based on the environmental contexts of the mobile system. The proposed tools and the application management strategy are evaluated through a trace-driven simulation and a 30 volunteers experiment. To evaluate the accuracy and overhead of ANEPROF, we design five sets of experiments to compare with other estimation schemes. With a 5% overhead and 14% maximal profiling error rate, ANEPROF can provide the accurate enough power consumption information for application designers. To verify Energy Hunter, we collect the energy consumption by ANEPROF as ground truth and compare the results with that from Energy Hunter. In the experiments, Energy Hunter can provide average 92% accuracy estimation. With ANEPROF and Energy Hunter, the proposed application management framework achieves 15% reduction of average application launch delay and 18% increase of average battery lifetime.