Skip to main content

Analyzing Energy Leaks of Android Applications Using Event-B


The number of mobile applications downloaded recently from Google stores increase steadily. It is believed that mobile applications market revenues will grow fast and receive more attention from software developers. Even though, hardware technologies and operating systems have made a big contribution to improve the battery capacity, power consumption is one of the most important and crucial non-functional properties of mobile applications. Many approaches have been dedicated for analyzing and optimizing the power consumption at different levels. This paper proposes a method for analyzing energy leaks of Android application at the design phase. First, it introduces a formalization of an event-based power consumption model. After that, the paper presents a method to translate this model to Event-B notations. Based on the target model, it is able to check if the application leads to energy leaks or violates the power consumption constraints based on formal proofs. Finally, the motivating examples are shown for the illustration purpose.

This is a preview of subscription content, access via your institution.

Fig. 1
Fig. 2
Fig. 3
Fig. 4


  1. 1.

    Android framework., 2018

  2. 2.

    Abrial J-R (1996) The B-book: Assigning Programs to Meanings. Cambridge University Press, New York

    Book  Google Scholar 

  3. 3.

    Abrial J-R (2010) Modeling in Event-B: System and Software Engineering, 1st edition. Cambridge University Press, New York

    Book  Google Scholar 

  4. 4.

    Abrial J-R, Butler M, Hallerstede S, Voisin L (2006) An open extensible tool environment for event-b. In: Liu Z, He J (eds) Formal Methods and Software Engineering. Springer Berlin Heidelberg, Berlin, pp 588–605

  5. 5.

    Abrial J-R, Su W, Zhu H (2012) Formalizing hybrid systems event-B. In: Proc ABZ 2012, volume 7316 of LNCS, pp 178–193

  6. 6.

    Carroll A, Heiser G, et al. (2010) An analysis of power consumption in a smartphone. In: USENIX annual technical conference, vol 14, pp 21–21. Boston, MA

  7. 7.

    Couto M, Carcao T, Cunha J, Fernandes JP, Saraiva J (2014) Detecting anomalous energy consumption in android applications. Lecture Notes in Computer Science (including subseries Lecture Notes in Artificial Intelligence and Lecture Notes in Bioinformatics) 8771 LNCS

  8. 8.

    Datta SK, Bonnet C, Nikaein N (2012) Android power management: Current and future trends. In: Enabling Technologies for Smartphone and Internet of Things (ETSIoT), 2012 First IEEE Workshop on, pp 48–53. IEEE

  9. 9.

    Kim D-H, Kim J-P, Hong J-E (2011) A power consumption analysis technique using uml-based design models in embedded software development. In: Proceedings of the 37th International conference on current trends in theory and practice of computer science, SOFSEM’11, pp 320–331, Berlin, Heidelberg. Springer-Verlag

  10. 10.

    Kim KH, Min AW, Gupta D, Mohapatra P, Singh JP (2011) Improving energy efficiency of wi-fi sensing on smartphones. In: 2011 Proceedings IEEE INFOCOM, pp 2930–2938

  11. 11.

    Le HA, Bui AT, Truong N-T (2019) An approach to modeling and estimating power consumption of mobile applications. Mob Netw Appl 24(1):124–133

    Article  Google Scholar 

  12. 12.

    Li D, Hao S, Halfond WGJ, Govindan R (2013) Calculating source line level energy information for Android applications. In: Proceedings of the 2013 international symposium on software testing and analysis - ISSTA 2013, pp 78

  13. 13.

    Liu Y, Wang J, Xu C, Ma X (2017) Navydroid: Detecting energy inefficiency problems for smartphone applications. In: Proceedings of the 9th asia-pacific symposium on internetware, internetware’17, New York, NY, USA. Association for Computing Machinery

  14. 14.

    Liu Y, Xu C, Cheung S-C, Terragni V (2016) Understanding and detecting wake lock misuses for android applications. FSE 2016, New York, NY, USA. Association for Computing Machinery

  15. 15.

    Nakajima S (2013) Model-based power consumption analysis of smartphone applications. In: Proceedings of the 6th international workshop on model based architecting and construction of embedded systems co-located with ACM/IEEE 16th international conference on model driven engineering languages and systems (MoDELS 2013), Miami, Florida, USA, September 29th, 2013.

  16. 16.

    Nakajima S, Ueda Y (2013) Power consumption analysis of smartphone applications using uppaal. In: Proceedings of the IEEE international conference on cyber-physical systems, networks and applications, Taiwan, August 19-20, 2013

  17. 17.

    Pathak A, Hu YC, Zhang M (2011) Bootstrapping energy debugging on smartphones: A first look at energy bugs in mobile devices. In: Proceedings of the 10th ACM workshop on hot topics in networks, HotNets-X, pp 5:1–5:6, New York, NY, USA. ACM

  18. 18.

    Pathak A, Hu YC, Zhang M (2012) Where is the energy spent inside my app?: Fine grained energy accounting on smartphones with eprof. In: Proceedings of the 7th ACM european conference on computer systems, EuroSys ’12, pp 29–42, New York, NY, USA. ACM

  19. 19.

    Pathak A, Jindal A, Hu YC, Midkiff SP (2012) What is keeping my phone awake? characterizing and detecting no-sleep energy bugs in smartphone apps. In: Proceedings of the 10th international conference on mobile systems, applications, and services, MobiSys ’12, pp 267–280, New York, NY, USA. Association for Computing Machinery

  20. 20.

    Patil PS, Doshi J, Ambawade D (2015) Reducing power consumption of smart device by proper management of wakelocks. In: 2015 IEEE international advance computing conference (IACC), pp 883–887

  21. 21.

    Vekris P, Jhala R, Lerner S, Agarwal Y (2012) Towards verifying android apps for the absence of no-sleep energy bugs. In: Proceedings of the 2012 USENIX conference on power-aware computing and systems, HotPower’12, pp 3–3, Berkeley, CA, USA. USENIX Association

  22. 22.

    Yoshimoto R, Kadono T, Hisazumi K, Fukuda A (2016) A software energy analysis method using executableuml. In: 2016 IEEE Region 10 conference (TENCON), pp 218–221

  23. 23.

    Zhang L, Tiwana B, Dick RP, Qian Z, Mao ZM, Wang Z, Yang L (2010) Accurate online power estimation and automatic battery behavior based power model generation for smartphones. In: 2010 IEEE/ACM/IFIP international conference on hardware/software codesign and system synthesis (CODES+ISSS), pp 105–114

Download references

Author information



Corresponding author

Correspondence to Hong Anh Le.

Additional information

Publisher’s Note

Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Rights and permissions

Reprints and Permissions

About this article

Verify currency and authenticity via CrossMark

Cite this article

Le, H. Analyzing Energy Leaks of Android Applications Using Event-B. Mobile Netw Appl 26, 1329–1338 (2021).

Download citation


  • Energy bugs
  • Event-B
  • Android apps
  • Power consumption