The widespread use of mobile applications in daily life has raised significant concerns about their energy consumption, as it directly affects user satisfaction, their hosting device longevity, and environmental sustainability. Despite the need for energy-aware mobile application development, developers lack cost-effective, software-based, and intuitive tools to measure and analyze energy usage during the development process. This paper introduces BCProf (Battery Consumption Profiler), a novel framework designed to measure the energy consumption of Android applications at both method and application granularities. BCProf supports both Java and Kotlin languages and is implemented as a plugin for seamless integration into Android Studio. BCProf works by instrumenting the application’s source code with custom log statements that enable tracking Android API calls. During application testing, BCProf monitors the generated logs alongside hardware component usage (e.g., WiFi, GPS, camera, Bluetooth, and screen) to calculate energy consumption. By leveraging this monitored data, BCProf correlates the energy usage of Android API calls and hardware components with specific methods in the application’s source code. The tool supports both online, real-time energy analysis during application execution and offline analysis by saving energy usage data in a JSON file format. Extensive evaluations were conducted across various Android applications to validate the accuracy and versatility of BCProf. The results show that BCProf can achieve up to 98% accuracy under specific conditions. This makes it a reliable and adaptable solution for the energy profiling of Android mobile applications.

错误:搜索内容不能为空,请输入英文关键词
错误:关键词超出字数限制,请精简
高级检索

BCProf: Battery Consumption Profiler for Android Applications

  • Lyla Naghipour Vijouyeh,
  • Luís Veiga,
  • Paulo Ferreira

摘要

The widespread use of mobile applications in daily life has raised significant concerns about their energy consumption, as it directly affects user satisfaction, their hosting device longevity, and environmental sustainability. Despite the need for energy-aware mobile application development, developers lack cost-effective, software-based, and intuitive tools to measure and analyze energy usage during the development process. This paper introduces BCProf (Battery Consumption Profiler), a novel framework designed to measure the energy consumption of Android applications at both method and application granularities. BCProf supports both Java and Kotlin languages and is implemented as a plugin for seamless integration into Android Studio. BCProf works by instrumenting the application’s source code with custom log statements that enable tracking Android API calls. During application testing, BCProf monitors the generated logs alongside hardware component usage (e.g., WiFi, GPS, camera, Bluetooth, and screen) to calculate energy consumption. By leveraging this monitored data, BCProf correlates the energy usage of Android API calls and hardware components with specific methods in the application’s source code. The tool supports both online, real-time energy analysis during application execution and offline analysis by saving energy usage data in a JSON file format. Extensive evaluations were conducted across various Android applications to validate the accuracy and versatility of BCProf. The results show that BCProf can achieve up to 98% accuracy under specific conditions. This makes it a reliable and adaptable solution for the energy profiling of Android mobile applications.