You are on page 1of 7

THE COMPARISON OF IMPACTS TO ANDROID PHONE BATTERY

BETWEEN POLLING DATA AND PUSHING DATA


Pham Cao Dinh
Department of Information Technology Management
King MongKuts University of Technology North
Bangkok
Bangkok, Thailand
dinhcaopham@gmail.com

Sirapat Boonkrong
Department of Data Communication and Networking
King MongKuts University of Technology North
Bangkok
Bangkok, Thailand
sirapatb@kmutnb.ac.th

see what states they are in, usually to see whether they are
still connected or want to communicate [2]. It works
completely appropriately for some types of content that is
actually changing constantly like weather information,
news headlines or stock quotes. The application can poll
very infrequently and then when the users actually start to
view or access data, immediately application can refresh
data.

ABSTRACT
Nowadays, energy saving solutions are interesting in all
fields of technology and Android is not an exception. All
Android users know that their mobile device has limited
battery consumption, so how can they use it as long as
possible? An efficient application that can run on the
Android OS is one of the most important ways to reduce
battery usage of the system. For this purpose, this paper
will concentrate on evaluating and comparing the impacts
of an Android phone battery with two techniques which are
the way an application gather data from the server over
the Internet known as polling and pushing data. Each
technique, an application was presented on Android OS
then they will be tested performance by Power Tutor.
Analyzing the results, this research will find a more
efficient way between polling and pushing data to reduce
battery usage when sync data applications operate.

Pushing data is an application or a service that will


establish and maintain a connection with the server over
the Internet and that allows the server to send data to the
application when something has actually changed on the
server. The Android API and the SDK allow applications
to run background services to establish or maintain a
connection between the server over the Internet and
application installed on the Android device. This technique
opens it up to all developers such as Cloud to Device
Messaging (C2DM) [3] that is a part of the Android
platform which has been developed by Google.

KEYWORDS: Polling data, Pushing data, Android,


Battery saving, C2DM.

Specifically, in this paper two applications will be created


for the Android device. Those are polling data application
and pushing data application. Moreover, this research will
compare and examine impacts to the Android phone
battery with traditional technology called polling data and
another way to get data known as C2DM.

I. INTRODUCTION
Day by day, the Android smart phone becomes more
popular than before [1]. It contains many applications that
are very useful for users. So the most interesting
applications are those that access data over the Internet.
Those applications can give users seamless access to data
wherever they are. To do this task, Android allows
developers to make applications that are background sync
applications. Currently, this is becoming more popular and
necessary because users can access their data wherever
they are. Applications can gather data from server
transparently when the server has some changes. It makes
sure that the latest data is reflected on the device as quick
as possible. Across all of these types of applications, there
is one fundamental challenge: How do Android
applications keep data on the device fresh or up-to-date?
There two basic techniques known as polling and pushing
data. Polling operation is very different from the way
pushing works. Therefore, their impacts on phone battery
are also different and will be investigated.

Accordingly, the structure of this paper is as follows


section 1: Introduction, section 2: Background Knowledge
will be presented referring to polling and pushing
techniques in more detail. Section 3: Methodology that
describes in development of applications, experiments and
tools used. The paper continues with section 4: Results and
Discussions. Finally, section 5: Conclusion and Future
works are presented.
II. BACKGROUND KNOWLEDGE
Android
Since these mobile devices have become more popular,
more distributive and more powerful, mobile computing
becomes more important. Today, the most popular mobile
operating systems are Apples iOS, Microsoft Windows
Mobile and Googles Android. Focusing on the Android

Polling data is one of the auto sync data techniques that are
continuously checked by other programs on the device to
84

Operating System, it provides the tools and APIs necessary


to begin developing applications on the android platform
[4]. The Androids main core architecture is the Linux
Kernel and some key applications like Google maps,
phone or browser. All applications on the Android phone
run on their own process with their own instance of Dalvik
virtual machine [5]. In this paper, the experiments were
run on the Android version 4.1 (Jelly Bean).

write data, use network usage and so on. Whenever the


application accesses data or uses a data network, it powers
up the radio which consumes power. Even when users
have finished accessing data, the radio stays on for a
couple of seconds, so polling can take toll of the Android
battery.

Battery consumption
Whenever developers create their application to run on the
Android system, battery usage becomes one of the most
important things that they should consider before that
application is deployed. There are many researches that
mention about the ways to save battery for example:
Monitoring Energy Consumption of Smart phones [6] it is
critical to monitor and analyze the energy consumption of
an application on smart phones. For this purpose, they
developed an application like a smart energy monitoring
system called SEMO for smart phones using the Android
operating system. It can profile mobile applications with
battery usage information, which is vital for both
developers and users. The idea is that: they try to run each
application, which has specific tasks with the OS system
and records battery usage for that application. After
gathering the data, authors analyze the collected data per
application and rank it. This helps users of the Android
device to know which kind of application has consumed
more battery than another.

Figure 1 Impact of polling on battery


Figure 1 shows a typical poll [9] from the Android
developer team. when devices are idle, it might even have
an open TCP connection with the server, but there is no
data being transmitted or received. The baseline power
draw is about five to ten milliamps. However, when the
application starts accessing and reading data from a cloud,
the power usage can jump to 115 milliamps. To write its
data, it is more consuming at around 200 milliamps or
more and radio signal stays on for few seconds. Thus, for
soft poll, applications might have consumed around
0.5mAh. It also means that, if an application is polled
every five minutes, then this adds up to around 144mAh
per day.

Android Smartphone: Battery Saving Service [7] which is


reports on development and evaluation of an Android
service to save power. It tries to utilize Smartphone idle
times to stop technologies such as Wi-Fi and Bluetooth
and applications that may consume battery power.
However, when users turn off those techniques, they have
no way to communicate with the Internet and some kinds
of sync applications will be wasted.

Normally, the battery of an Android phone consumes


around 1000mAh to 1500mAh. Consequently, with a
polling application, it is over ten per cent (10%) of a
battery from one application that is polled every five
minutes. If an application polls data every 15 minutes it
might be a little bit better (Application consumes about 48
milliamp per hour). Like everything in engineering, there
is a tradeoff between freshness and efficiency. If sync
applications polls very frequently, the application will
have fresh data but it is not going to be efficient. On the
other hand, if sync applications polls less frequently, data
will not be fresh but it will be a bit better on the battery.

Energy consumption of Android phones when using


wireless communication technologies [8] presents results
from a measurement study where authors measured energy
consumption
of
three
wireless
communication
technologies: Bluetooth, Wi-Fi and 3G.
Polling
Day by day, auto sync data application becomes more
convenient with users of smart phones. Those kinds of
application can update content automatically. Base on that,
Android auto sync application has two ways to achive this.
One way is polling data. Periodically, polling applications
is downloads data from the server. One advantage of the
polling technique is that is simple to implement but a lot of
times the data in the server is not changed that frequently.
When working, polling data consume power to read data,

Pushing data
Pushing data uses C2DM which is a new Google API. It
can be implemented from Android version 2.2 or on the
85

device. C2DM makes use of the existing persistent


connection that is already used to power push in Google
applications so that persistent connection is amortized
across a number of an applications. With Android cloud
messaging, the server of the application can send
lightweight data messages to the application on a devices
and is typically used to tell application when something
has changed. That is also the way to answer the question
from polling the technique, when is good time to sync
data. Application will fetch data from the server when
something has actually changed.

work with the web server. It also provides a very


convenient API for manipulating and extracting data.
Jsoup will be used to download selective data from each
web server. The downloaded data will be stored like a
document type and it will be converted to text type that can
be shown by TextView on the Android program. Then,
make sure that the application will be re-connected and
download data after each fixed period. A Thread is created
and developers will be able to define Thread Sleep time.
For pushing applications, the web server mentioned above
will be re-used but it needs to add more features. A textbox
will be created for users. This will provide the ability to
send text data to android device. That message is also
stored in the database of the web server where polling can
work and download content. Pushing application uses a
service known as C2DM from Google, so before using a
web server, it is necessary to register and get a project ID
from Google APIs Console. With that ID, a connection
between the web server and C2DM font end is created.
The C2DM also generates another ID, which is provided to
the Android device, this ID makes sure that another
connection between the Android phone and C2DM was
created. Whenever text data is created and is sent, it will
go through the C2DM server and arrives at the Android
phone immediately.
Tools
All applications are programmed with Java programing
language. It is developed on the Android SDK (Software
Development Kit) by using a plug-in for Eclipse called
ADT (Android Development Tools). Polling, pushing data
application and Power Tutor were tested on both emulator
and real device. The version 4.1 (Jelly Bean) of Android
devices was tested.

Figure 2 Pushing data model


Figure 2 shows the way C2DM sends a lightweight data
package from the application server to the android phone.
In here, we suppose that Android device has already
established a connection with our connection servers. The
application server will go ahead and send a simple HTTP
Post that contains a message to C2DM. C2DM receives
that request and stores the message in their database. They
route the request to the appropriate connection server
thats housing a connection from the target device. Then
the connection server will send the message to the Android
phone. At this point, two things happen in parallel. First,
that message will be converted to an Intent, which is
broadcast to wake up or start up an application. Secondly,
the device will acknowledge receipt of that message so
they can clear that from the database (in step 2) The
application wakes up, and then it can go ahead and fetch
its latest data from the application server.

Moreover, the tool that was used to calculate battery usage


of polling and pushing data applications is power Tutor.
This tool provides more detail about battery usage of
system or each application. It also allows users to see
statics of battery consumption in real time or within period
time [10].
Experiment
Two applications here, polling and pushing content data
were downloaded from only one server source with same
data size. It also means that the comparison between
polling and pushing data on the impact to android phone
battery became more independent.

III. METHODOLOGY
Methodology

In this experiment, the polling application will be operated


every 5 seconds, so it re-downloads new data from the
server but there are two scenarios for the polling
application. First, polling application works with no data
traveling through the network. Second, scenario changes
size of data travel between server and application, the data

A web server was created for polling applications, which


can make a connection and download text data
automatically and periodically. In this case, Jsoup library
will be used. Jsoup is a Java library, which has ability to
86

size is one kilobyte. Power Tutor will calculate battery


usage of each case. Similar to the pushing application, it
also has two scenarios to test. Firstly, server will push no
data and then one kilobyte data will be pushed to the
applications every 5 seconds.

speed. Basically, if a network slows down then time to


finish one poll will be longer than normal. Therefore, that
is the answer for the reason why some times the battery
consumption jumps up to 80 or 100mW.
Pushing data performance with NO data travelling
200

With the pushing application, it uses a C2DM technique,


which is provided by Google, the quota of this technique is
unlimited. It means that, the server sends an unlimited
number of messages but it has a restriction of the data size
that the maximum is 1-kilobyte. That is the reason why we
selected this size of data for testing.

mW
Average: 0.2135

180
160
140

mW

120
100
80

IV. RESULTS AND DISCUSSION


60
40

In this case of study, the researcher considers about two


test cases. Firstly, test case of initial performance and
examine both applications when no data travels between
server and android device. Secondly, it is a test case when
1-kilobyte of data is transmitted. Some small tests around
2000 seconds per test were completed, sending one
message per 5 seconds.

20
0

400

600

800
1000
1200
Time(Seconds)

1400

1600

0.2135
2000

1800

Figure 4 shows the results of battery consumption with no


data travelling for a push application. Whenever a push
application operates, the first status of battery usage is
similar to the polling application. Battery consumption
jumps up to 178mW. However, push applications uses
different ways to catch data that are pushed by the server
when some things actually were changed or added. It
means that, when there is no data travelling, the
application is still in an idle state. Moreover, pushing
applications also need to keep persistent connection
between the Connection Server and itself so that a few
points jump up to 2 or 4mW in an idle state. For this result,
within 2000 seconds, there are no data transmitted so the
average of this experiment is 0.2135mW.

Polling data performance with no data traveling


200
mW
Average: 19.86

160
140
120
mW

200

Figure 4 Pushing data performance with No data


travelling

No data travelling

180

100
80
60

One kilobyte data travelling

40
19.86

20

Polling data performance with 1k data travelling


240

200

400

600

800

1000 1200
Time(seconds)

1400

1600

1800

mW
Avarage: 79.07

220

2000

200
180
160

Figure 3 Polling data performance with no data


travelling

mW

140
120
100

Figure 3 shows the detailed test results of polling data


performance with No data travelling through. With this
result, it shows that when an application starts the battery
consumes higher than normal. It jumps up to 200mW and
in a normal state of this polling it consumes around 20mW.
Moreover, the time gap between 2 polling times is 0mW.
During 2000 seconds, this application polls 400 times so
the average was collected about 19.86mW per time. The
amount of battery consumed also depends on network

79.07

80
60
40
20
0

200

400

600

800
1000
1200
Time(Seconds)

1400

1600

1800

2000

Figure 5 Polling data performance with 1-kilobyte data


travelling
87

Turn to the second experiment, both applications were


operated together, every 5 seconds polling checks the web
server and downloads 1 kilobyte data from there. Similar
to the polling application, pushing applications also has 1k
data to download every five seconds from the web server.
In this case, figure 5 shows that, the percentage of battery
usage is higher than the last polling experiment. It also
proves that battery consumption depends on size of data
downloaded. The average battery consumption in this case
is 79.07mW. With this experiment, it is not hard to see the
gap of battery consumption between polling and pushing
data, even the gap between the ways to catch 1-kilobyte of
data compared to no data catched.

V. CONCLUSION AND FUTURE WORK


This paper has presented the compassion between polling
and pushing data and the impacts to Android phone
battery. For each technique, authors have created their own
applications that make sure that they can download data
from the Internet automatically. Then both of them were
calculated referring to impacts to the battery usage with
fair scenarios by Power tutor. The result shows that,
pushing applications have the ability to save battery more
than polling application. For future work, the optimize
impact to battery consumption of polling and pushing data
techniques will be deployed and normal polling, pushing
applications will be compared with optimized techniques.

Pushing performance with 1k data travelling


200

REFERENCES

mW
Avarage: 21.41

180
160

1)

Gartner, Gartner Says Worldwide Mobile Device


Sales to End Users Reached 1.6 Billion MW in 2010;
Smartphone Sales Grew 72 Percent in 2010, Gartner
Says Worldwide Mobile Device Sales to End Users
Reached 1.6 Billion MW in 2010; Smartphone Sales
Grew
72
Percent
in
2010.
Available:
http://www.gartner.com/it/page.jsp?id=1543014.

2)

Feng Gao Gutierrez, J., A trade-off analysis model:


towards improving polling efficiency for network
monitoring, in Communication Systems, 2002.
ICCS 2002. The 8th International Conference, on
Nov 2012, pp. 363-367.

3)

Jarle Hasnen, Tor-Morten Gronli, Gheoghita Ghinea,


Cloud to device Push Messaging on Android: A
case study, in Advanced Information Networking
and Applications Workshops (WAINA), 2012 26th
International Conference in Fukuoka, pp. 1298
1303.

4)

Jae Kyu Lee, Jong Yeol Lee, Android Programming


Techniques for Improving Performance in
Awareness Science and Technology (iCAST), 2011
3rd International Conference, in Dalian, ISBN: 9781-4577-0887-9, Sept. 2011, pp. 386 389.

5)

David Ehringer, The Dalvik virtual machine


architechture, March, 2010 available on:
http://show.docjava.com/posterous/file/2012/12/1022
2640-The_Dalvik_Virtual_Machine.pdf

6)

Fangwei Ding, Monitoring Energy Consumption of


Smartphones,
in
Internet
of
Things
(iThings/CPSCom), 2011 International Conference
on and 4th International Conference on Cyber,
Physical and Social Computing, on Oct. 2011, pp.
610 613

7)

Zahid, I., Center for IT Advancement, Int. Islamic


Univ. Malaysia, Kuala Lumpur, Malaysia, Android

140

mW

120
100
80
60
40
21.41

20

200

400

600

800
1000
1200
Time(seconds)

1400

1600

1800

2000

Figure 6 Pushing data performance with 1-kilobyte


data travelling
For pushing applications, figure 6 shows the result of
measurement. The scenario was unchanged, and the
average of the result is 21.41mW. This number shows that,
it is really similar to the average number of polling data
with no data travelling although 1-kilobyte data
transmitted.
Base on the results of some experiments, this research
makes users understand how polling and pushing data
works and it also shows the impacts on battery of both
techniques. It will help users to choose the right techniques
or right applications that run on their android devices.
With similar objectives, users have choices of which
technique will be used, which technique is more
convenient than the others and which one is comfortable
technique with some kinds of application. For example,
polling techniques should be used with another kinds of
contents that are updated periodically like weather
applications, news headline applications and so on. With
pushing applications, it might be comfortable and become
more efficient with some messaging applications where
users can send and get messages immediately.

88

Smartphone: Battery saving service, in Research and


Innovation in Information Systems (ICRIIS), 2011
International Conference on 23-24 Nov. 2011, pp. 1
4.
8)

Kalic, G., Bojic, I. , Kusek, M., Energy


consumption in android phones when using wireless
communication technologies, in MIPRO, 2012
Proceedings of the 35th International Convention, on
May 2012, pp. 754 759

9)

Debajit Ghosh, Building Push Applications for


Android Google IO, in Moscone West, San
Francisco, on May 2010. Available on:
http://ebookbrowse.com/ android-push-applicationsandroid-pdf-d385370943.

10) L.Zhang, et al. "Accurate online power estimation


and automatic battery behavior based power model
generation for smartphones." in Proc. of ACM
CODES+ISSS10. Scottsdale, Arizona, USA,
2010,pp. 105-114.

89

90

You might also like