Content uploaded by Willian Zamora
Author content
All content in this area was uploaded by Willian Zamora on Jun 23, 2023
Content may be subject to copyright.
Energy Consumption for Anti-virus
Applications in Android OS
Elsa Vera-Burgos1(B
), Willian Zamora1,2(B
), Homero Mendoza-Rodriguez1(B
),
Alex Santamar´ıa-Philco1,2(B
), Denise Vera-Navarrete1(B
),
and Patricia Quiroz-Palma1,2(B
)
1Universidad Laica Eloy Alfaro de Manab´ı, Manta, Ecuador
{elsa.vera,homero.mendoza,dennisse.vera}@uleam.edu.ec
2Universitat Politecnica de Valencia, Valencia, Spain
wilzame@posgrado.upv.es, {asantamaria,patquipa}@dsic.upv.es
Abstract. The present investigation aims to carry out a comparative
study on the energy consumption associated with the applications of
anti-virus for smartphones running with the Android operating system.
The characteristics and attributes of the devices used in this study are
provided, with the details of the functionality offered by the different
anti-virus applications. A methodology is proposed that includes the
development of an application that through a service performs periodic
measurements of the remaining percentage of the battery and the volt-
age demanded by the applications; allowing to estimate the variations of
the voltage generated by anti-virus applications and their energy impact
on the battery. The experimental results show that in general, anti-virus
applications have a high power consumption with power levels ranging
from 6 to 16 mW when the application is active, although the different
anti-virus solutions are also verified.
Keywords: Energy consumption ·Mobile devices ·Anti-virus ·
Android ·Smartphone
1 Introduction
Smartphones or mobile devices have attractive services and features of comput-
ing that compete with the performance of personal computers; however, they
consume a lot of energy [1]. Most of the mobile devices use rechargeable elec-
trochemical ion batteries lithium (Li-ion) that are short-lived, especially when
the connection to data networks is kept active, and other applications and ser-
vices are used continuously [2]. As a result, the duration of battery charging has
become a problem of availability for the user, because the battery will not last
long enough; therefore, battery life is one of the top priorities of the manufac-
turers of mobile devices [1].
Some tools measure the electrical consumption in different mobile devices; for
example, the DOZE tool is included in the Android platform [3], that monitor the
c
Springer Nature Switzerland AG 2019
´
A. Rocha et al. (Eds.): ICITS 2019, AISC 918, pp. 335–345, 2019.
https://doi.org/10.1007/978-3-030-11890-7_33
336 E. Vera-Burgos et al.
percentage consumption, at the level of components and applications. Also, in
Google Play one can find apps that model the power consumed by the principal
components such as the CPU, communication interfaces, mobile screen, GPS
and other applications used. When referring to these type of applications, the
antivirus [4], appears, as the primary measure to protect the device against
malware attacks, since this constitutes a constant and real threat that seriously
affects the user, emotionally or financially. This scenario turns the antivirus into
an indispensable application in a mobile device and, therefore, deserve to be
studied especially concerning the subject of energy consumption [4], even more,
if we consider that they have not evolved to the point of being efficient like the
versions that protect personal computers.
This contribution is summarized as follows:
– A methodology was proposed that allows to monitor the energy consumption
of antivirus applications on mobile devices with Android operating systems.
– An application was developed that runs in the background and allows to
register the values relative to voltage, battery percentage and capacity.
– The results obtained were evaluated and compared through statistical graphs.
The rest of this document is organized as follows: in Sect. 2we present some
related works; in Sect. 3, we describe the different components that make up
the proposal; in Sect. 4, we describe the evaluation methodology; in Sect. 5the
experimental results of the evaluation are shown and in Sect. 6the conclusions
and future works are presented.
2 Related Works
Battery life is an essential factor in the development and deployment of appli-
cations and services on mobile devices, so the user has to be informed of the
available energy percentage, to provide it with a convenient use, considering
that the execution of some applications demand higher battery consumption
and the user can decide whether to use them or not.
Due to the need to know how much energy a mobile device consumes, several
investigations have emerged, such as the one made by Manet et al. [5], in which
they analyze the power consumption by the IEEE 802.11 interface in different
modes of operation, demonstrating how the transmission traffic rate discharge
the battery.
In other investigations [6,7]y[8], most of the energy consumed in mobile
devices are attributed to communications; to the GPS and the display [9]; to the
applications that execute processes in the background [2]; to Bluetooth, Wi-Fi,
cellular radio, data network and even the lighting generated by the screen [2,6,10,
11]. In general, if the applications do not use the hardware prudently, it increases
the energy consumption, for example, the frequency of waking the device in the
background and simultaneous transfers of data through the Internet [10].
The research reviewed reflects several types of problems, some of the mod-
els designed to get the data and evaluate the power consumed of the various
Energy Consumption for Anti-virus Applications in Android OS 337
components of a smartphone are taken with electronic devices, able to obtain
these values in real time, but these only work on devices with the same type of
technology [8].
Regarding the developers of mobile applications, they must recognize the
energy needs of their applications [12], because in a certain way each use that
runs on a mobile device contributes differently to battery consumption [13]and
antivirus programs cannot be an exception.
Finally, in the present bibliographical review works were found [14,15], which
evaluate the energy efficiency of specific antivirus programs for the Android plat-
form. Precisely, they measure energy consumption during various operations like
the process of scanning the application after installation, the full scanning of the
device, and scanning of the SD card. Our proposal differs from the previous
bibliographical works since we measure the general impact of different antivirus
programs on the power consumption in the battery of a smartphone, and addi-
tionally we propose a base methodology for a said proposal.
3 Description of the Proposal
The proposal of the methodology consists of four components that are shown in
Fig. 1. The main component is the service that runs in the background, developed
in Android Studio [16]. The second component is the reading of the energy
consumption for the mobile device in its different states: Suspended, Active and
Inactive. In the third component, the different antivirus applications that must
Fig. 1. Components of the proposed methodology.
338 E. Vera-Burgos et al.
be installed and initialized for their respective evaluation. Finally, the component
that performs the statistical extraction and analysis of the results.
3.1 Power Management in Android
The Android operating system performs a power management associated
with the methods of Linux, APM (Advanced Power Management) and ACPI
(Advanced Configuration and Power Interface); however, it employs a more
aggressive policy management of energy saving, with the premise that the CPU
does not consume energy if there are no applications or services that need energy,
therefore it has its own power management extension called PowerManager,
which provides low level drivers in order to manage the peripherals supported.
Awakelock[17] is a function of the PowerManager service, which allows
to control the energy state of the device dynamically [6], the applications and
components have to create and acquire wakelocks to keep the assets active, if
there is no active wakelock, the CPU shuts down and goes to a low consumption
status.
There are three built-in states in the PowerManager state machine to the
energy management model (i) SLEEP, (ii) NOTIFICATION and (iii) AWAKE.
When an application acquires a complete wakelock, it can produce an event
by screen activity or keyboard and the device will be maintained or changed
to AWAKE status; If the waiting time passes or the on/off button is pressed
the transition to the NOTIFICATION state occurs. While a partial wakelock is
acquired, the device will keep in NOTIFICATION status if all partial wakelocks
are released, the device goes to the SLEEP state, if in this mode all the resources
are activated, the transition to the AWAKE state occurs.
Table 1shows which wakelocks are available and used by Android to reduce
the power consumption in a mobile device.
Table 1. Wakelocks in Android.
Flag value CPU Screen. Keyboard.
PARTI A L WA KE LOCK ON OFF OFF
SCREEN DIM WAK E LOCK ON DIM OFF
SCREEN BRIGHT WAK E LOCK ON BRIGHT OFF
FULL WAK E LOCK ON BRIGHT BRIGHT
3.2 Antivirus Applications
In this component you will find the different antivirus that have been considered
for evaluations. Five of the twenty-five security products for Android, in its
most current versions, better ranked in a study conducted in November 2015
were taken as reference [18]. Table 2shows the characteristics of the selected
antivirus applications.
Energy Consumption for Anti-virus Applications in Android OS 339
Table 2. Characteristics of antivirus applications.
Funci´on Avast Eset Kaspersky McAfee Norton
Malware detection Yes Yes Yes Yes Yes
Anti-theft service Yes Yes Yes Yes Yes
Call blocking Yes Yes Yes Yes Yes
Filter messages Yes Yes Yes No No
Secure browsing Yes Yes Yes Yes Yes
Parental control No No No No No
Backup copy No No No Ye s Ye s
Data coding No No No No Ye s
3.3 Background Service
The measures of energy consumption of the mobile device have been taken by
software, taking advantage of the capabilities provided by the Android operat-
ing system, through an application (app) developed to monitor the energetic
demand. The application records at all times the remaining percentage of bat-
tery, capacity and voltage, in order to calculate the power consumed.
The source code of the application is composed of two Java classes:
– monitor.java.- Here you define the “activity” that starts or ends the service.
– service.java.- Defines the service and operations to be performed. When the
service is loaded for the first time, the ACTION BATTERY CHANGED
event occurs, which receives the voltage, capacity and the remaining per-
centage of energy in the battery.
To obtain the numerical value of the state of the battery, the BatteryManager
class [19], which allows you to obtain battery data, such as capacity in mAh,
voltage, technology, temperature, its charging state, among other information
regarding the battery has been used. As mentioned before, the application reg-
isters the capacity, the voltage and the remaining percentage of the battery.
The capacity is recorded in the variable EXTRA LEVEL and the voltage in the
variable EXTRA VOLTAGE, these two variables are used to calculate power
consumption.
When the application is run for the first time, a service is initialized and, no
user interface is needed, and as long as variations in battery discharge does not
occur, there will be no CPU consumption or any other resource of the device.
3.4 Data Analysis
In this component the stored data is extracted from the internal or external
memory of the smartphone for statistical analysis in the graphic tool R [20],
generating various graphics: (i) Box and Whisker plots to show the voltage, (ii)
Bar graphs, to show the remaining energy of the battery, and (iii) Line graphs
340 E. Vera-Burgos et al.
used for comparing the discharge of the battery both with the execution of
the different antivirus applications without scanning the device, and with the
smartphone in suspended status. These results are shown in Sect. 5.
4 Test Methodology
The evaluation of the energy consumption has been done installing the applica-
tion developed on the device; so that it is possible to obtain the consumption
value while the device is on but does not execute any task or process, in this
way a reference measure is obtained in order to observe how much energy con-
sumption increases with the use of the antivirus application. To obtain exact
values, we must ensure that all data network interfaces are inactive and that
the only application running is the one developed on the device. In this way, we
will determine the state where the energy consumption is lowest. On the other
hand, to calculate the power consumed when antivirus applications are used,
two states have been defined:
– No Scanning: When antivirus applications are installed and with its active
services.
– Scanning: When antivirus applications are constantly scanning files and other
applications of the device; it is expected that in this state, it will increase the
power consumed.
Figure 2shows the flow diagram of the monitoring application. The mobile
device used for the different evaluations was a Samsung Galaxy J5 with Android
Fig. 2. Flow diagram of the monitoring application.
Energy Consumption for Anti-virus Applications in Android OS 341
5.1.1 Lollipop, operating on version 3.10.49- 787809 of the Linux kernel. The
developed application was installed, and three samples of five consecutive hours
for each evaluation were made. The samples were recorded in ten-second inter-
vals. In the antivirus applications for the case of scanning the folders and appli-
cations of the mobile device, we used a 32 GB MicroSD memory loaded with
the detailed information as (photographs, videos, documents, music, and among
others).
5 Results
The results are described below according to the proposal and methodology
described in Sects. 3and 4respectively. The active, inactive and suspended states
were evaluated. Because the battery is not exactly a linear device [6], exact power
values are not always obtained, therefore, to determine the average consumption
of an antivirus application you get several power values and the average of them
is calculated.
5.1 Tests of Battery Discharge in Suspended State
In the tests performed, the device’s battery is initially charged to 100%, where
the monitoring application begins the registration of all the variations presented
by the battery until the five hours is up. The discharge of the battery was
evaluated when the device did not have any installed antivirus applications.
This measure serves as a reference to verify when the consumption increased for
each antivirus application. Figure 3shows the discharge of the device’s battery
in suspended state (black line). It can be seen that battery life is prolonged
without the use and installation of antivirus applications, since we can observe
that it is still around 69% remaining capacity after the five hour mark is up.
Fig. 3. Battery discharge by having the antivirus applications installed but not scan-
ning the device, and with the smartphone in suspended state.
342 E. Vera-Burgos et al.
5.2 Anti-virus Applications in Suspended and No Scan Mode
After having the initial battery discharge data without antivirus applications
installed on the device, reaching a remaining capacity of 69%, the evaluation
was carried out with installed antivirus applications, running in the background
but not scanning files. Figure 3shows the results of these tests and reflects that
the antivirus applications quickly reduce the battery life of the mobile device,
Norton being the application that consumes the most energy leaving the battery
in a 44% remaining capacity and Eset, the lowest power consumption in this
state.
5.3 Antivirus Applications in Active and Scanning Mode
To verify the discharge time of the device’s battery in Active mode, we proceeded
to evaluate the antivirus applications in complete Scanning mode of the different
folders in search of some type of virus or malware.
Figure 4shows the voltage variation of the different antivirus applications,
registering significant ranges between Norton and Kaspersky. Table 3shows the
remaining capacity of the battery according to the scan time of each antivirus
application. The variations of the mobile device’s voltage in the inactive and
suspended states associated with the applications. In addition, McAfee as the
most energy-consuming antivirus application, leaving the battery with a remain-
ing capacity level of 96%, while the lowest-consuming antivirus application was
Avast.
Fig. 4. Analysis of energy consumption of antivirus applications.
5.4 Power Measurement
To evaluate the energy consumption level of the mobile device, we collect data
from the voltage and capacity readings of the device to calculate the power
consumed by the device. In Li-ion batteries of mobile devices, the voltage changes
Energy Consumption for Anti-virus Applications in Android OS 343
Table 3. Summary antivirus application in active state.
Scan time (s) Antivirus % Remaining battery
1080 seg MacAfee 96%
1680 seg Kaspersky 97%
450 seg Eset 98%
430 seg Norton 99%
300 seg Avast 100%
during the discharge, allowing them to consider the power consumed. As the
voltage varies, the capacity level of the battery decreases. This means that the
power consumed can be calculated from the changes in voltage and the capacity
level of the battery cell. The formula to calculate the energy consumed during a
specific time interval is the following:
P=C1∗V1−C2∗V2
t1−t2
[6] (1)
Where, P refers to the power consumed, the variables (t1−t2), refers to the
time interval, the values of the remaining capacity level are represented with C1
yC2expressed in mAh and with V1and V2as reference to the voltage value.
The actual available capacity of the mobile device must be taken into account
due to deterioration and with the passage of time this can decrease significantly.
Table 4shows the values of power consumed in each one of the states
explained above and for each one of the evaluated antivirus applications.
Table 4. Power consumption by antivirus applications.
Antivirus (mW)
Avast Eset Kaspersky Norton McAfee
Active 6.45 8.33 14.94 11.45 16.33
Suspended 15.13 11.74 14.19 18.10 13.44
Inactive 1.01 1.20 1.08 2.07 1.30
6 Conclusion
In this paper, a methodology was proposed that allows to monitor the energy
consumption of mobile devices with Android operating systems, associated
with antivirus applications. Application developed allows recording the levels
of energy consumption produced by the above antivirus applications selected. In
the tests performed, it was verified that, in two of the three states (Suspended,
Active and Inactive), the Norton antivirus application is the one that showed the
344 E. Vera-Burgos et al.
highest battery consumption. On the other hand, the antivirus apps that pre-
sented lower energy consumption were Eset and Avast. The results show that
there is a significant decrease in energy, based on this it can be deduced that
security providers do not develop antivirus applications with moderate energy
consumption profiles. It should be noted that, in this evaluation, the perfor-
mance of these antivirus apps was not measured. For future work, it is intended
to improve the application for better data collection, as well as evaluate other
parameters concerning the benefits of the antivirus applications through different
devices brands and models.
References
1. Perrucci, G.P., Fitzek, F.H., Sasso, G., Kellerer, W., Widmer, J.: On the impact
of 2G and 3G network usage for mobile phones battery life. In: 2009 Euro-
pean Wireless Conference, pp. 255–259. IEEE (2009). https://doi.org/10.1109/
EW.2009.5357972
2. Martins, M., Cappos, J., Fonseca, R., Martins, M., Cappos, J., Fonseca, R.: Selec-
tively Taming Background Android Apps to Improve Battery Lifetime
3. Optimizing for Doze and App Standby. http://developer.android.com/training/
monitoring-device-state/doze-standby.html
4. Pieterse, H., Olivier, M.S.: Security steps for smartphone users, pp. 1–6 (2013).
https://doi.org/10.1109/ISSA.2013.6641036
5. Manet, L.E., Anne, F., Jean-yves, M., Serge, F.A.: Energy Consumption Models
for Ad-Hoc Mobile Terminals
6. Estudio del consumo de energ´ıa. In: Univeridad Carlos III de Madrid, pp. 54–55
(2012)
7. Bytheway, I., Grimwood, D.J., Jayatilaka, D.: Wavefunctions derived from exper-
iment. III. Topological analysis of crystal fragments., Acta crystallographica.
Section A, Foundations of crystallography 58(Pt 3), pp. 232–243 (2002)
8. Malik, M.Y.: Power Consumption Analysis of a Modern Smartphone, p. 11 (2012).
arXiv:1212.1896
9. Carroll, A., Heiser, G.: An analysis of power consumption in a smartphone. In:
USENIXATC 2010 Proceedings of the 2010 USENIX Conference on USENIX
Annual Technical Conference, p. 21 (2010)
10. Datta, S.K., Bonnet, C., Nikaein, N.: Minimizing energy expenditure in smartde-
vices (ICT), pp. 712–717 (2013). https://doi.org/10.1109/CICT.2013.6558187
11. Vallina-Rodriguez, N., Hui, P., Crowcroft, J., Rice, A.: Exhausting battery statis-
tics, p. 9, February 2010. https://doi.org/10.1145/1851322.1851327
12. Anand, A., Manikopoulos, C., Jones, Q., Borcea, C.: A Quantitative Analysis of
Power Consumption for Location-Aware Applications on Smart Phones, pp. 1986–
1991 (2007). https://doi.org/10.1109/ISIE.2007.4374912
13. Shye, A., Scholbrock, B., Memik, G.: Into the wild, p. 168 (2009). https://doi.org/
10.1145/1669112.1669135
14. Bickford, J., Park, F., Varshavsky, A., Park, F.: Security versus Energy Tradeoffs
in Host-Based Mobile Malware Detection
15. Polakis, I., Diamantaris, M., Petsas, T.: Powerslave : Analyzing the Energy Con-
sumption of Mobile Antivirus Software, vol. 3, pp. 165–184 (2015). https://doi.
org/10.1007/978-3-319-20550- 2
Energy Consumption for Anti-virus Applications in Android OS 345
16. Download Android Studio and SDK Tools. http://developer.android.com
17. Datta, S.K., Bonnet, C., Nikaein, N.: Android power management: current and
future trends. In: 2012 The First IEEE Workshop on Enabling Technologies for
Smartphone and Internet of Things (ETSIoT), December 2015, pp. 48–53. IEEE
(2012). https://doi.org/10.1109/ETSIoT.2012.6311253
18. AV-TEST- The Independent IT-Security Institute (2015).https://www.av-test.
org/es/antivirus/moviles/android/noviembre-2015
19. Android Developer BatteryManager. http://developer.android.com/intl/
reference/android/os/BatteryManager.html
20. R-Foundation, R project available (2015).https://www.r-project.org