Using Smartphone Bases Biodevices for Analyzing Physiological,
Psychological and Behavioral User’s Habits
Federico Guede Fernández
1
, Marc Pous Solà
1
, Miguel Ángel García González
1
,
Lluís Capdevila Ortís
2
, Juan Ramos Castro
1
and Mireya Fernández Chimeno
1
1
Universitat Politècnica de Catalunya, Campus Nord C4 Jordi Girona 1-3, Barcelona, 08034, Spain
2
Universitat Autònoma de Barcelona, Campus de la UAB Edifici B Bellaterra, Cerdanyola del Vallès, 08193, Spain
Keywords: Android, Real-time, Biomedical Monitoring, Biosensor.
Abstract: As a consequence of increasing life expectancy, the promotion of lifestyles that allow aging wellbeing
guarantees has acquired great importance in the developed countries. However, the adherence to healthy
behaviors in young and adult people remains as a big problem in the community health field. The
development of markers of adherence to healthy lifestyles and the evaluation its effectiveness is a goal of
many research groups. This paper presents a system for analyzing physiological, psychological and
behavioural user’s habits using a smartphone and externals biodevices. We use an Android smartphone with
an internal tri-axial accelerometer and GPS to monitor physical activity. The smartphone is connected via
Bluetooth to a respiratory sensor for breath monitoring. In addition, Android application contains
psychological questionnaires to analyze user’s mood state and at the same, social interaction is analyzed
tracking phone usage and user’s social network. Finally, the collected information is sent to a remote server
for a long-term processing.
1 INTRODUCTION
As a consequence of increasing life expectancy, the
promotion of lifestyles that allow aging wellbeing
guarantees has acquired great importance in the
developed countries. However, the adherence to
healthy behaviors in young and adult people remains
as a big problem in the community health field. The
development of markers of adherence to healthy
lifestyles and the evaluation its effectiveness is a
goal of many research groups.
Healthy lifestyles includes among others, regular
exercising and daily physical activity, eating and
sleeping habits, and stress control. In order to
measure the adherence to these healthy lifestyles, is
necessary to have non-intrusive measurement
devices, almost transparent for the users, and
measurement protocols suitable for every particular
application.
The application fields of healthy lifestyle
adherence measurements range from monitoring old
people habits to the sportsmen and sportswomen
quality of training measurement. They also include
driver somnolence control, quality of life of workers
in shift, or simply individual self-help applications.
Many handheld mobile devices have high speed
data transmission capabilities (e.g., 3G, WiFi) and
embedded microprocessors with the capability to
communicate, using wireless connection (e.g.,
Bluetooth, NFC), with external sensors. Moreover
mobile devices have internal sensors (e.g.,
accelerometer, gyroscope), supplied by powerful
processors and large storage capacities. So,
smartphones are strong candidates to be used as
biodevices for monitoring parameters related with
healthy lifestyle behaviors. From the monitoring
point of view, the main advantage of mobile devices,
compared to laptops or desktop computers, is that
these devices are always handled by the user
collecting data during the whole day.
The smartphone market has grown, from being a
niche market product segment, becoming a truly
mass-market. In 2011, total annual global shipments
of smartphones exceeded those of client PCs
(including pads) for the first time (Canalys, 2012).
In fact, in Europe the smartphone penetration have
grown just 47.6% (comScore, 2012). Regarding
operative systems in smartphones, Gartner research
shows Android’s handset annual sales reached 82,1
million units in first quarter of 2012, in comparison
243
Guede Fernández F., Solà M., García González M., Capdevila Ortís L., Ramos Castro J. and Fernández Chimeno M..
Using Smartphone Bases Biodevices for Analyzing Physiological, Psychological and Behavioral User’s Habits.
DOI: 10.5220/0004206802430248
In Proceedings of the International Conference on Biomedical Electronics and Devices (BIODEVICES-2013), pages 243-248
ISBN: 978-989-8565-34-1
Copyright
c
2013 SCITEPRESS (Science and Technology Publications, Lda.)
with last year sales represents a growth of 123%.
This means that Android accounted more than half
of all smartphone sales (56.1%) (Gartner, 2012).
In the area of medicine preventive there some
studies about the relation among obesity, nutrition
and physical activity (Hensrud, 2010). Another
study concludes that sleep loss is associated with
having an unhealthy lifestyle.(Ohida et al., 2001).
In several mobile health-care applications,
mobile devices are used as gateway for receiving
bio-information from medical portable devices and
mobile sensors. There, mobile device is responsible
of collecting data from sensors, pre-processing the
raw signals and transferring the gathered data to
remote server (Yang & Gerla, 2011).
For daily mood assessment, there is an android
application that combines accelerometer, sound
sensor, light sensor, GPS, and SMS information
(Yuanchao et al., 2012). In some applications,
mobile device also processes the gathering data and
only when mobile detects an emergency, it sends an
alert to a server or to social contacts (Sposaro &
Tyson, 2009).
Internal sensors of smartphone are used to
monitor heart rate variability using internal
accelerometers and recording the seismocardiogram
signal (Ramos-Castro et al., 2012).
This work exploits the increasing capabilities of
smartphones and its success between the people to
promote healthy life habits in people. The purpose of
this work is to develop an Android application to
analyze physiological, psychological and behavioral
personal habits. First we have to collect data to get
information about user’s life habits. Then
application shows some data to user and some
information will be sent to a server in order to a
third-party can process this information and monitor
the level of healthy habits.
2 MATERIALS AND METHODS
2.1 Android OS
Android is an open-source software stack created for
mobile phones and other devices produced by
Google. The Android SDK provides the API
libraries and developer tools required to build, test,
and debug applications. Android applications are
written in Java programming language and they run
on the Dalvik virtual machine optimized for mobile
devices. Android gives an open marketplace for
distributing it to Android users called Google Play.
Application components are the essential building
blocks of an Android application.
There are four different types of application
components: Activities, Services, Broadcast
receivers and Content providers. Each type serves a
distinct purpose and has a distinct lifecycle that
defines how the component is created and destroyed.
Our application uses activities, for user-interaction,
and a broadcast receiver that responds to system-
wide broadcast announcements, like Bluetooth
device have been found. Activities start on the main
application thread, therefore blocking I/O operations
or time-consuming processing have to be executed
in our own threads to avoid blocking the activity.
The layout is the architecture to design the user
interface (UI) in an activity. Layouts may be
declared using XML files or using Java code in
runtime. The main advantage of using XML files to
design the UI is that enables to separate the
presentation tier of the Activity logic tier that
controls its behavior (Google Inc., 2012a). This
improves the maintenance for later works.
Therefore, our application uses XML files.
We have selected Android OS to develop our
application for the following reasons: Android is an
open-source software and development tools are free
of charge; it also allows to interact easily with
internal sensors such GPS to track physical activity,
accelerometer to activity monitoring; it provides
simplified and well-documented Bluetooth, WiFi
APIs to communicate with external sensors.
Moreover there are several APIs to develop quickly
powerful applications.
2.2 Internal Sensor
Nowadays, the smartphones have integrated many
internal sensors, such as accelerometer, magnetic
field sensor, light sensor, GPS and proximity sensor.
The main advantage of these sensors is that they
don’t require an external communication channel,
such as Bluetooth of WiFi improves the battery
consumption and the facility to access the data
provided by the sensor.
For example, the accelerometer has been
employed in several applications to detect human
movement detection, to characterize physical
activity (Shin et al., 2010) recognizing if the user is
walking, going upstairs or running (Brezmes et al.,
2009). In our application we have developed filters
to reduce noise; Butterworth second order high-pass
filter is implemented. The accelerometer gives three
axis forces applied on the smartphone, in the
implemented application the contribution of earth
gravity have been removed.
BIODEVICES2013-InternationalConferenceonBiomedicalElectronicsandDevices
244
Another sensor available in most of the mobile
phone is the light sensor. This can be used to detect
user light exposure. Nevertheless this sensor is not
useful to measure the level of sun exposure because
if the mobile phone is in the pocket or bag, do not
provide information of user exposition. For this
reason this sensor isn’t useful for this propose.
So, in function of the application, several
external sensors must be connected to the device, but
this is not a problem with the level of connectivity of
these devices
2.3 Breathing Monitoring
Breathing is a good indicator of somnolence
(Rodríguez-Ibañez et al., 2011). In order to record
the respiration signal we use an external monitoring
system (Bioplux Respiband sensor). It consists in a
respiratory sensor based on an inductive band to
measure thoracic effort. This sensor has the
embedded electronic to calculate breath signal.
Moreover, it has a Bluetooth communication module
that makes possible to connect it to smartphone.
Then, mobile application may monitor the breath
signal in real time. Mobile device parses data
received and displays breath signal to user.
Bluetooth communication uses Serial Port Profile
(SPP) that defines how to set up virtual serial ports
and connect two Bluetooth enabled devices. Once
Respiband has been connected to smartphone, it
starts to send data continuously to a frequency
configured between 36 Hz and 1000 Hz. In our
application the sampled frequency selected is 40 Hz.
This frequency is enough to characterize properly
the breath rate signal and reduce power consumption
due to Bluetooth transmission.
Android application has an activity to manage
Bluetooth connection. This activity lists paired
devices and allows to scan new devices, to pair and
to connect. Once paired an own thread is started to
establish RFCOMM channel and to maintain the
communication. This thread is continuously reading
new incoming data in real-time. When an incoming
packet is detected, the application parses it to extract
one byte of CRC and three bytes of value data.
Firstly CRC is checked to verify data integrity and
secondly, the application sends measured breath
value to UI to plot it. The data is visualized using an
open source charting library called AChartEngine
(4ViewSoft, 2012).
If the Bluetooth connection is
lost, the application detects it and tries to reconnect
continuously since user exit
2.4 User Location Monitoring
Android application uses location provider to track
exercise, using speed data, distance traveled and the
altimeter.
Android OS provide different methods to
determine the device’s current location, they are
called location providers, and each has its different
characteristics. Each location provider offers
different capabilities, including differences in power
consumption, accuracy, and the ability to determine
altitude or speed or heading information. The three
different locations providers are GPS_Provider,
Network_Provider, Passive_Provider. Therefore
each one is suitable to work over different
conditions. Using the Android Location Manager
API we can find available location providers, obtain
device’s current location, track movement, set
proximity alerts for detecting movement into and out
of a specified area.
GPS_provider determines location using
satellites. Depending on conditions, this provider
may take a while to return a location fix, this time is
called Time to First Fix (TTFF.) This time can be
cut down substantially by employing Assisted GPS
(A-GPS). A-GPS uses the mobile network to
transmit the precise GPS satellite orbit and clock
information to a mobile device. Then the device will
know the approximate location of the GPS satellites
in its line of sight. Reducing the number of
frequency bins which must be searched to acquire
the signal reduces the TTFF (Jarvinen et al., 2002).
The main limitation of GPS_provider is that it
only can work in outdoor environment, because in
indoors GPS signals don't reach. Moreover this
provider consumes more battery than the others.
Furthermore, GPS_provider provides the most
accurate location data and it is unique that has ability
to determine altitude information. Therefore, we
need use GPS_provider to track people exercise
properly.
Our Android application has a dedicated activity
that employs GPS_provider to obtain the user’s
location. Using information of location obtained, in
real-time, our application calculates main parameters
concerning a healthy behavior such as total traveled
distance, average speed and time spent. Apart from
displaying the parameters explained before the
application shows the route followed by the user
using maps. There are several libraries that provide
maps, we used Google Maps API (Google Inc.,
2012b) and an open alternative called OSMDroid
(Gramlich, 2012) to display OpenStreetMap (OSM).
The usage of both APIs is quite similar for
UsingSmartphoneBasesBiodevicesforAnalyzingPhysiological,PsychologicalandBehavioralUser'sHabits
245
programmer. Android application uses overlays to
draw followed route with points and lines. The main
disadvantage of Google Maps that it has a prize
policy of use otherwise OSM is totally free of use.
We have considered that more times while user
is doing exercise he is looking away from the screen.
Then for a better human-interaction Android
provides text-to-speech, application speaks to user to
notify each certain time period distance traveled and
time spent. Text to speech API provided for Android
it is used to implement this.
2.5 Social Interaction Tracker
Social interaction is important to human health. In
fact, individuals with adequate social relationships
have a 50% greater likelihood of survival compared
to those with poor or insufficient social
relationships. The influence of quality and quantity
of individual’s social relationships on the risk of
death are comparable with well-established risk
factors for mortality such as smoking and alcohol
consumption and they exceed other many risk
factors such as physical inactivity and obesity.
(Holt-Lunstad et al., 2010).
On the other hand, one of the most important
concerns associated with mobile phone use is that it
may become uncontrolled or excessive, which has
an impact upon daily living. Sleep disturbance is
among the most common negative outcomes
resulting from overuse of the mobile phone (Thomée
et al., 2011). Furthermore, smartphones allows
people to engage in a wide range of online
activities—such as Internet surfing, managing email,
playing video games or involvement in social
networks (e.g., Facebook, Twitter). Therefore,
mobile phone addiction should be conceptualized
within a broader spectrum of “cyber addictions” that
covers a wide range of behaviors relying on online
activities and/or activities involving communication
among individuals through technological devices.
Social network addictions is one of the most
frequent “cyber additions” (Billieux, 2012).
Android application can collect some
information about social interaction. On the one
hand, in order to track incoming and outgoing phone
calls and SMS, the application registers
BroadcastReceiver to track the phone usage. This
information is useful to evaluate social relationship.
Nowadays new social networks based on Internet are
very used to social interaction; Facebook and
Twitter are currently the most popular ones. Our
application uses Facebook (Facebook, 2012) and
Twitter API (Yamamoto, 2011) for Android parsing
JSON data received to collect information about
user’s social network like number of friends,
frequency update status, messages.
2.6 Psychological State Evaluation
Professionals and researchers are working in the
relationships existing between physical activity and
mood state. The most popular instrument for mood
state evaluation is POMS (McNair, 1984).
Questionnaire is a subjective method to evaluate
mood sate. Android application implements a test of
POMS with fifteen questions to evaluate user´s state
of mood obtaining the components of stress,
depression, hostility, vigor, and fatigue (Andrade et
al., 2010). The user has to indicate how the user
feels in 0-10 scale where 0 means not all and 10
very. There are three questions for mentioned
component to avoid random answers. In the
beginning and at the end of respiratory acquisition
the application launches the questionnaire to be
filled by the user. The results of the test answered by
the user provide useful information to study the
relationship between psychological, physiological
and behavioral habits.
3 RESULTS
Android application will forward physiological,
psychological and behavioral data obtained to a
remote server for a long term processing via
Android TCP socket when application finishes. It
uses Wi-Fi connection to reduce connection cost and
to increase rate transmission.
The breath signal acquired using Respiband
external sensor is monitored in real-time by the
application developed. In Figure 1, a screen captured
shows a XY graph displaying in y-axis the value of
amplitude and x-axis the samples. This graph is
refreshed when a packet of data is received. Usually
there is a packet for each sample of Respiband; its
sample rate is 40 Hz. The designed layout included a
graph to plot respiratory signal on time domain in
real-time. To plot the data the open source charting
library called AChartEngine is used.
For user’s location monitoring, application
shows the route tracked displaying it over a map. In
our application we have used two technologies that
provide maps: GoogleMaps API (Figure 2a) and
OpenStreetMap API (Figure 2b). In addition, the
application calculates and displays information
about distance traveled, average speed and time
spent. In order to improve the accuracy of this
BIODEVICES2013-InternationalConferenceonBiomedicalElectronicsandDevices
246
information, user can pause and resume the tracking,
this is essential to avoid wrong results.
Figure 1: Mobile application screenshot: graphical breath
signal represented in real-time.
(a) (b)
Figure 2: Screenshots: route tracked using Google Maps
(a). Route tracked using OpenStreetMap (b).
The application has provided us useful types of
data to analyze social activity. In the application the
number and time when an SMS is sent or received
has been monitored. It also has allowed tracking the
duration, the number and the time of outgoing and
incoming phone calls. Concerning the social
networks, the application has been capable to
analyze the activity on Facebook and Twitter. The
application has obtained the number of friends that
is associated with the contact network size. In
addition to measure the social activity, the wall
panel, messages and notifications have been
checked. On Twitter social network published tweets
by the user, mentions, direct messages, the number
of followers and “following” have been quantified.
To evaluate the mood state in the application a
test with fifteen questions is launched in the
beginning and at the end (Figure 3a). The five
components of the mood state mentioned in section
2.6 have calculated each time when the user
completes the questionnaire (Figure 3b).
(a) (b)
Figure 3: Screenshots: a question of the test to evaluate the
mood state (a). Graph that represents the five components
resulted of a completed test (b).
The results obtained are stored in a database
proving us information of the psychological state
when the user is monitored.
4 CONCLUSIONS
A smartphone based on biodevice for healthy
lifestyle adherence evaluation has been developed.
The Android application developed collects the
information about different variables (activity,
respiration, social activity, etc.) and processes them
to measure the adherence to healthy lifestyles. The
data are sent to a remote server for further
processing to get results to improve user lifestyle.
ACKNOWLEDGEMENTS
This work has been partially funded by the Spanish
MINISTERIO DE CIENCIA E INNOVACIÓN.
Proyecto IPT-2011-0833-900000. Healthy Life style
and Drowsiness Prevention-HEALING DROP.
REFERENCES
4ViewSoft. (2012). AChartEngine: Charting Library for
UsingSmartphoneBasesBiodevicesforAnalyzingPhysiological,PsychologicalandBehavioralUser'sHabits
247
Android (Version 1.0.0) [Software]. Available from
http://code.google.com/p/achartengine/downloads/list
Andrade, E., Arce, C., Torrado, J., Garrido, J., De
Francisco, C., and Arce, I., (2010). Factor structure
and invariance of the POMS mood state questionnaire
in spanish. Spanish Journal of Psychology, 13(1), 444-
452.
Billieux, J., (2012). Problematic use of the mobile phone:
A literature review and a pathways model. Current
Psychiatry Reviews, 8(4), 299-307. doi:
10.2174/157340012803520522.
Brezmes, T., Gorricho, J. L. and Cotrina J., (2009).
Activity recognition from accelerometer data on a
mobile phone. In Proceedings of the IWANN ’09, 796–
799.
Canalys, (2012). Smart phones overtake client PCs in
2011. Retrieved February 3, 2012, from
http://www.canalys.com/newsroom/smart-phones-
overtake-client-pcs-2011.
comScore, (2012). Number of european smartphone users
accessing news surges 74 percent over past year.
Retrieved March 22, 2012, from
http://www.comscore.com/Insights/Press_Releases/20
12/3/Number_of_European_Smartphone_Users_Acces
sing_News_Surges_74_Percent_Over_Past_Year.
Facebook, (2012). Android Tutorial. Retreived May 18,
2012, from https://developers.facebook.com/
docs/mobile/android/build/
Gartner. (2012). Gartner says worldwide sales of mobile
phones declined 2 percent in first quarter of 2012;
previous year-over-year decline occurred in second
quarter of 2009. Retrieved May 16, 2012, from
http://www.gartner.com/it/page.jsp?id=2017015.
Google Inc. (2012a). Android developer guide: Layouts.
Retrieved May 11, 2012, from
http://developer.android.com/guide/topics/ui/declaring
-layout.html.
Google Inc. (2012b). Google Maps Android API -
External Library. Retreived June 1, 2012, from
https://developers.google.com/maps/documentation/an
droid/index
Gramlich, N. (2012). OSMDroid: OpenStreetMap-Tools
for Android (Version 3.0.8) [Software]. Avaliable
from http://code.google.com/p/osmdroid/
Holt-Lunstad, J., Smith, T. B., & Layton, J. B., (2010).
Social relationships and mortality risk: A meta-
analytic review. PLoS Medicine, 7(7) doi:
10.1371/journal.pmed.1000316
Jarvinen, J., DeSalas, J. & LaMance, J., (2002). Assisted
GPS: A Low-Infrastructure Approach. Retrieved
March 1, 2002, from http://www.gpsworld.com/wp-
content/uploads/2012/09/gpsworld_Innovation_0302.p
df
McNair, D., (1984). Citation classic - manual for the
profile of mood states. Current Contents/social &
Behavioral Sciences, (27), 20-20.
Ohida, T., Kamal, A. M. M., Uchiyama, M., Kim, K.,
Takemura, S., Sone, T and Ishii, T., (2001) The
influence of lifestyle and health status factors on sleep
loss among the Japanese general population. SLEEP,
24(3), 333–338.
Ramos-Castro, J., Moreno, J., Miranda-Vidal, H., García-
González, M .A., Fernández-Chimeno, M., Rodas, G.
& Capdevila, Ll., (2012). Heart Rate Variability
analysis using a Seismocardiogram signal. In
Engineering in Medicine and Biology Society, EMBC
2012. Accepted.
Rodriguez-Ibanez, N., Garcia-Gonzalez, M. A.,
Fernandez-Chimeno, M., & Ramos-Castro, J., (2011).
Drowsiness detection by thoracic effort signal analysis
in real driving environments. 33rd Annual
International Conference of the IEEE Engineering in
Medicine and Biology Society, EMBS 2011, Boston,
MA. 6055-6058. doi: 10.1109/IEMBS.2011.6091496
Shin, J., Shin, D., Shin, D., Her, S., Kim, S., & Lee, M.,
(2010). Human movement detection algorithm using 3-
axis accelerometer sensor based on low-power
management scheme for mobile health care system
(Hualien ed.) doi: 10.1007/978-3-642-13067-0_12
Sposaro, F., & Tyson, G., (2009). iFall: An android
application for fall monitoring and response. 31st
Annual International Conference of the IEEE
Engineering in Medicine and Biology Society:
Engineering the Future of Biomedicine, EMBC 2009,
Minneapolis, MN. 6119-6122. doi:
10.1109/IEMBS.2009.5334912
Thomée, S., Härenstam, A. & Hagberg, M., (2011).
Mobile phone use and stress, sleep disturbances, and
symptoms of depression among young adults - A
prospective cohort study. BMC Public Health, 11 doi:
10.1186/1471-2458-11-66
Yamamoto, Y., (2011). Twitter4j: an open-sourced Java
library for the Twitter API. (Version 2.0.4) Avaliable
from http://twitter4j.org/en/index.html
Yang, S. & Gerla, M., (2011). Personal gateway in mobile
health monitoring. 2011 9th IEEE International
Conference on Pervasive Computing and
Communications Workshops, PERCOM Workshops
2011, Seattle, WA. 636-641. doi:
10.1109/PERCOMW.2011.5766966
Yuanchao, M., Bin, X. Yin, B., Guodong, S. and Run,
Zhu, (2012). Daily Mood Assessment Based on
Mobile Phone Sensing. In Wearable and Implantable
Body Sensor Networks, 2012 Ninth International
Conference on, 142-147.
BIODEVICES2013-InternationalConferenceonBiomedicalElectronicsandDevices
248