Experience Sampling
a participant craves a cigarette, or to poll periodically for in- find these hidden spatial and temporal correlations [21].
formation, for example to determine a participant’s general
fatigue level throughout the day [23]. 2.3 Design
AndWellness has been designed with requirements for two
2.2 Dashboard roles: researchers looking to customize and run campaigns
While the components form the mobile application and to collect feedback on experiences and behaviors from par-
back-end server, the final piece is the front end, a person- ticipants in situ, and participants who collect and upload
alized dashboard. Participants and researchers can use the data. Researchers use the system to match their individual
dashboard to view a summary of upload statistics to quickly research needs, while participants expect the mobile applica-
see that their data is being uploaded correctly. If the study tion to fit unobtrusively into their daily lives. For both, the
is incentivized in some manner, participants can view their system must be usable, low power, able to ensure privacy,
current progress.2 and transparent.
The dashboard also has a page to visualize currently up-
2.3.1 Usability
loaded data. The same data types that are used to config-
ure the campaign are downloaded from the server and used Designing for usability translates into building an unob-
to automatically format the dashboard with default visual- trusive application on the mobile device. Whether the par-
izations. The visualizations are split by survey, and each ticipant is given a phone for the study with the application
survey question has its own graph type. Sensor readings already installed, or the participant installs the application
also have their own meaningful visualizations. Participants on their own phone, we adhere to number of basic usability
are able to view collected data and have instant feedback tenets to enhance participant retention. Participants will be
to motivate them to both continue the study and to posi- more willing to stick with an application that does not be-
tively change their behavior. Researchers can use the visu- come cumbersome over time, especially if they are answering
alizations to identify trends and correlations in behaviors, multiple surveys a day. The application avoids interfering
perhaps in response to a change in medication or correlate with standard phone operation and does not drain the phone
different moods with various behaviors. An example of a battery too quickly, notify or require the participant’s atten-
visualization to show sleep data is shown in Figure 1. tion more than necessary, nor exhibit high latency during
Our system can also collect GPS data at regular inter- participant interaction.
vals, thereby allowing both survey data and activity infer- The mobile application is itself easy to learn and use. Ac-
ence data to be associated with location data. We have plans tive surveys are listed on the front page and are launched
to provide participants with a map view for display, along with a single click. Prompts clearly state the prompt text
with additional correlation tools to find relations between and are answerable with two clicks: the desired response and
time, location, and surveys responses. For instance, perhaps the next button. If a participant does not desire to answer
the participant’s mood changes when they go to a certain a specific survey question for any reason, they can click a
location such as work in the morning, or their home at night. skip button to move on to the next question. The prompts
While these relationships can be hard to discover, previous themselves can condition on answers to previous prompts,
research shows that even when handling complex human be- thereby allowing branching and reducing the potential num-
havior patterns, well thought out visualizations can help to ber of prompts a participant must complete. Once the sur-
veys are complete they are loaded into a queue for later
2
Various studies offer money or other incentives per survey upload, which checks for a stable network connection every
answered to increase the response rate. half hour and automatically uploads pending data. Over-
Figure 2: Example of the survey selection screen Figure 3: An example of a single survey question
from our Android application. Four surveys have with an integer range response type. The possible
been defined. The user can either wait for the spe- responses are 0 to 4 and map to four labels which are
cific survey triggers or select a survey to take at displayed in the survey and also in the automatically
anytime. generated visualizations.
2.3.3 Privacy
all, the application has been designed to require a minimum
amount of interaction and to minimize interference with the When enrolling in studies or deployment, participants ex-
user. pect their data to be kept securely. A participant may be
asked to submit potentially personal or private information.
To protect their privacy, all data are transported using end-
2.3.2 Power to-end encryption. Each response contains the user’s cre-
To help ensure a usable experience, the phone implemen- dentials and is authenticated before being stored into the
tation has been designed to minimize interference with stan- database. User names are created using randomized dic-
dard phone operation, which means to exhibit low latency tionary strings to preserve participant anonyminity. The
and, more importantly, low power drain. These goals re- database itself is designed with all potentially identifiable
quire an efficient design and consideration of CPU and bat- information cordoned off into its own section. The informa-
tery power when collecting and uploading potentially large tion can be made only accessible by authorized individuals,
amounts of data. A participant wants the battery to last or even permanently stripped off to remove any connection
long enough to avoid having to constantly recharge the phone between data and user identity.
which may not be possible. The irritation of a failing battery However, privacy issues go hand in hand with usability.
can cause participants to drop out of a study or to uninstall Imagine an example scenario where a user decides to install
the application. AndWellness to collect activity traces. The user starts the
Our main sources of battery drain comes from continuous application and logs in to begin collecting data. However, if
sensor readings, for example reading from the accelerome- the network connectivity is poor, the user credentials cannot
ter or the GPS, and network access either over the mobile be immediately validated. To preserve usability, the user ex-
radio or wifi. Continuous sensor readings are useful as they pects to start to collect data immediately without lengthy
can convey a large amount of information about a partici- delays or latency. The phone stores the user’s login informa-
pant without requiring the participants attention. However, tion, then uploads the data later when the login credentials
they can both over sample from sensors and generate a large are validated. Other tensions between usability and privacy
number of data points that are then sent back to the server include how often to make the user login, how often to vali-
through network access. Currently, continuous location and date with the server, and how to handle the situation where
activity sensor have been optimized to balance battery drain multiple users share the same phone.
with accuracy. They are tunable to allow the researcher to
adjust the balance between resolution and power drain, with 2.3.4 Transparency
a default setting that presents good accuracy while using Wireless technology allows unprecedented transparency
acceptable amounts of power. We have also implemented and engagement to the data collection process not found in
a system that scans wifi access points to determine if the earlier systems such as paper diaries or isolated PDA style
participant is moving or not. If the set of nearby wifi access devices. Participants data are uploaded in near real time to
points does not change, the participant is assumed to be still the back-end server. They can use their dashboard to view
and the system will not enable the GPS, saving a noticeable feedback about their data collection process and to know
amount of power. their device is working correctly or get help if it is not. The
Figure 4: The modular layers of the server architec-
ture. Incoming server calls start at the HTTP layer,
Figure 5: The server application is designed to have
make their way down to the database, then return
as few dependencies as possible. The application
to the HTTP layer to send any responses.
runs in Spring, which in turn runs in Tomcat, which
is a Java based web server that can execute in any
JVM.
data collection process itself becomes clear and meaningful,
which adds motivation to the participant to continue to col-
lect more data. to quickly add or replace modules of functionality at every
layer. Second, the system has been designed to handle large
3. IMPLEMENTATION streams of incoming data. The main server processing struc-
AndWellness has three separate groups of code: the Java ture is loaded into memory at server startup, hence each
based server, Android code that runs on the mobile device, request only consumes a minimal amount of memory. An
and the JavaScript based client-side website. increasing number of concurrent requests will not overflow
server memory. Finally, the data generated from the con-
3.1 Server tinuous sensor samples can be quite large and dense.4 We
The AndWellness server is implemented in Java 1.6 and plan to use scheduled data preprocessing jobs to condense
is hosted in the Apache Tomcat 6.0 environment. Collected these sets into more manageable sizes which will drastically
data are stored in a MySQL 5.1 database. A single archive reduce lookup latency.
file packages the compiled code and necessary dependen-
cies, including java and mysql binaries for both windows and 3.2 Phone
linux.3 A new server machine can be installed by unzipping The AndWellness mobile application is implemented us-
the package into the /opt/aw directory and running the OS ing the standard Android development framework in the
appropriate startup scripts for the database and server. A Java programming language. The phone software is setup
bit more setup is required to enable SSL with a signed cer- to match the campaign configuration on the server.5 After
tificate for secure data upload. reading in the configuration, the phone automatically gener-
The server is implemented using a REST style architec- ates the survey questions and response inputs. After logging
ture [7]. HTTP based APIs control access to upload data in, a participant sees a display showing the surveys that can
to the server from the mobile devices, and to retrieve the be responded to at anytime, as shown in Figure 2. If al-
data from the server for display. Incoming HTTP requests lowed, the user can open the settings menu to adjust the
are parsed into a custom AwRequest object, which is passed trigger times for daily triggered surveys. The implementa-
down through multiple validation, service, and database lay- tion is simple and robust, allowing the user to answer surveys
ers. After the request hits the database, the AwRequest at anytime, whether or not they have a network connection.
object is passed back up to the HTTP layer which sends Responses are stored on the phone until the upload service
a response back to the caller. Figure 4 shows a graphical is triggered, which securely transmits the data to the server
representation of these various layers and how incoming re- with end to end reliability, ensuring no data is lost.
quests filter through.
As the server forms the backbone of AndWellness, we have 3.3 Visualizations
concentrated on server scalability. First, our use of the The online data visualizations have been implemented in
Spring framework provides component replaceability and JavaScript, an open source language that runs in most mod-
flexibility which allows our system architecture to scale with
4
new features easily. Programmer time is scarce and ex- Sensors sampling at 1Hz generates 86,4000 samples a day
pensive, and our system is designed to allow developers or about 2.5 million samples a month.
5
The ability for phones to automatically download and syn-
3
Tomcat will run in any operating system with the appro- chronize with the campaign configuration is currently under
priate java binaries. development.
The vast majority of AndWellness CPU cycles are used
for continuous sensors, mainly real-time activity inference.
Each inference sample reads a measurement from both the
GPS and the accelerometer and performs some basic clus-
tering to determine the most likely user activity. The infer-
ence rate can be changed from the phone application and
ranges from once a second to once a minute, or completely
off. To examine CPU overhead, the application was set to
sample activity one per second, once every 30 seconds, once
per minute, and finally not at all. The overall CPU usage
times were measured and averaged for each setting over an
hour long period. The results are shown in Figure 6. As
we increase the inference rate from 1 Hz to 60 Hz, the CPU
utilization only increases a couple percent, showing that the
inference itself is quick and efficient.
Figure 6: The resource utilization of our AndWell- 4.1.2 Network and Storage
ness mobile application collecting activity inferences
Another meaningful limited resource is network usage and
at 0 Hz, 1 Hz, 2 Hz, and 60 Hz. The GPS takes some
storage. Inferring activity once per second can build up a
time to initialize, so even sampling at 1 Hz keeps the
large amount of queued data waiting for upload. Upload-
GPS utilization close to maximum.
ing causes a noticable drain on battery life and can slow
other network access. To measure network usage and stor-
ern web browsers. Although JavaScript can have overhead, age, again each of the activity sampling rates were selected,
it gives enough flexibility to allow both the user and the par- but this time the phone was left charging with a strong con-
ticipant to interact with their data without installing custom nection to upload data immediately after collection. The
software. To ensure a low latency experience, the data vi- results can be seen again in Figure 6. Sampling at once per
sualizations have been implemented to handle potentially second uses about 670 KB an hour.
large amounts of data. The continuous sensors can generate
high resolution data and attempting to visualize this directly 4.1.3 Battery Life
would require downloading and displaying over half a mil- The main uses of battery life are the CPU and sensors with
lion points. Instead, the system constantly pre-aggregates network usage being a somewhat distant third, so again mo-
any collected data into much lower resolutions and exposes bility inference and other continuous samplings constitute
various HTTP APIs to allow the visualizations to grab only the main cost. To measure the impact of AndWellness on
the necessary resolution of data. As the data is transported the battery, we run the sampling activity at the above rates
in relatively inefficient ASCII JSON, the server seamlessly and measure the rate of battery drain for each.
gzips the JSON before transport to minimize latency waiting These measurements highlight the fact that both the GPS
for arrival. and accelerometer do not shutoff, no matter the sampling
rate. Therefore, the only difference in battery drain is the
4. EVALUATION amount of network traffic generated, which does not notice-
We explore the impact of AndWellness on Android phones ably impact the battery drain. However, we did find that
by measuring the CPU, GPS, and accelerometer usage, net- the entire battery is drained in about 7.6 hours with activity
work usage, and overall battery life. We also examine feed- inference running. This is unfortunately fast, as the typical
back from a group of in lab participants who ran our software user will not be able to fully recharge their battery that of-
over a two week period. ten. However, turning the sampling off completely allows
AndWellness to have virtually no impact on battery life.
4.1 Phone Performance The main battery drains here are the GPS and accelerome-
ter, and we plan to adjust the activity inference module to
AndWellness can run on any Android based mobile device,
better duty cycles those sensors.
but our initial target for deployment is the first generation
G1. The phone uses a Qualcomm MSM 7201A 528 MHz pro-
cessor, 192 MB RAM, and a 1150 mAh lithium ion battery. 4.2 Case Studies
To document application performance we use SystemSens, We have run a two week in lab deployment of our system
a background process to log detailed system information [6]. using the same campaign settings from a planned future de-
SystemSens continuously system statistics such as CPU uti- ployment. Participants were given a G1 Android device,
lization, network usage, and current battery percentage in along with a user name and instructions to fill out surveys
the background and uploads them to a local server. from current studies, described in Section 5.4.2. There are
four surveys, each triggering once per day with the standard
4.1.1 CPU Utilization Android notifications. Over the two weeks, the response rate
The CPU is one of the main limited resources on mobile stayed a relatively high 85%, even though the participants
devices. Mobile phone CPUs are by nature low power to were not reminded to fill out the surveys except by the phone
help maintain battery life. Over utilizing the CPU risks itself. We have additionally held a number of focus groups
making the phone less responsive and hence less usable for to direct development and have two upcoming studies that
the participant. plan to use AndWellness. These are discussed in Section 5.4.
5. DISCUSSION adhering to these strict protocols gives a tension between
Here we discuss various issues implementing and design- privacy and usability. Participants do not want to have to
ing AndWellness including data quality, privacy designed to constantly login, click “Are you sure?” boxes, or remember
comply with the Institutional Review Board (IRB) standard arcane passwords, and too much emphasis on privacy could
practices, and transparency.6 We review feedback from in lead to a frustrated participant and reduced adherence rates.
lab testing, initial testing for two planned studies, and sev- Our system can fit either need by its database design, and
eral focus groups. allowing for the fine tuned configuration of these parameters.