Presented at the 2nd ACM Workshop on Mobile Systems for Computational Social Science. Workshop paper: http://www.cl.cam.ac.uk/~nkl25/publications/papers/lathia_mcss2013.pdf
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Open Source Smartphone Libraries for Computational Social Science
1. Open Source Smartphone Libraries for
Computational Social Science
@neal_lathia, k. rachuri, c. mascolo, g. roussos
september 2013
2. “...each of these transactions leaves
digital traces that can be compiled into
comprehensive pictures of both
individual and group behaviour...
“Computational Social Science” Lazer et. al
4. “... a number of challenges remain in
the development of sensor-based
applications [...] there is mixed API and
operating system (OS) support to
access the low-level sensors...”
“A Survey of Mobile Phone Sensing,” Lane et. al
5. ● Battery-friendly sensor data collection
● Triggering notifications
● Data storage & transmission
“Reinventing the Wheel”
All smartphone-based research needs to
begin by engineering solutions for:
10. ● Current approach:
– Requires treating each sensor with different code
– Hides battery & energy efficiency requirements
● We have built Android ESSensorManager
– Everything is a “sensor”
– Simple API with two modes (get, subscribe)
– API exposes battery issues to programmer
Sensor Data Collection
11. ● Pull Sensors
– Accelerometer, Location, Microphone
– Wi-Fi, Bluetooth, Camera
– Active apps, SMS/Call Log Content
● Push Sensors
– Battery, Connection State
– Proximity, Screen
– Phone Calls/SMS Events
Everything as a 'Sensor'
13. // get the instance
ESSensorManager sm =
ESSensorManager.getSensorManager(context)
// ask for some data
MicrophoneData data
= (MicrophoneData) sm.getDatafromSensor(
SensorUtils.SENSOR_TYPE_MICROPHONE)
Get data, fast
15. // make a subscription
int sid = sm.subscribeToSensorData(
SensorUtils.SENSOR_TYPE_MICROPHONE,
listener)
// deal with data pushed to you
class Listener implements SensorDataListener
{
public void onDataSensed(SensorData d){..}
public void onCrossingLowBatteryThreshold(..) {..}
}
Get data, continuously
16. ● “I need to ask the user for some interaction...”
– Based on time of day, randomly
– Based on a sensor event
– ESTriggerManager
● “I need the data to come back to me!”
– Without using up all of my participant's 3G
connection
– ESDataManager
Problems #2 & #3
17. ● JSON formatting
– Flexible for various sensors
– Includes sensing configuration
{
"zAxis":[9.959879,9.959879,....],
"senseStartTime":"17:07:00:281 16 05 2013 -0500 CDT",
"sampleLengthMillis":8000,
"xAxis":[0.11492168,0.11492168,0.0766144548,...],
"yAxis":[0.11492168,0.11492168,0.0766144548,...],
"sensorTimeStamps":[1368742020298,1368742020488,....],
"sensorType":"Accelerometer"
}
Data Management
18. ● Simple on-phone data querying
– Only queries local data
– “Give me all the accelerometer data from the last
hour...”
Data Management
19. ● Configurable Transfer Policy
– Do not transfer (local storage only)
– Transfer immediately (or fail)
– Asynchronous transfer (Wi-Fi & timeout)
Data Management
20. ● Student Project at Birkbeck College, London
– Post-graduate students with programming
experience
– Sample Audio data from the environment
– Measure noise pressure/audio features
– Post data to COSM (Xively)
Preliminary Feedback
21. ● Why wasn't it used?
– Lack of experience; support for emulator
● Using the library
– Easy, quick
– Substantially less code (~ better quality): focus is
on app features, not sensor engineering
● What is missing?
– Data filters; inference algos; simulated data
Preliminary Feedback
22. “it is useful for the research community
to think about and propose sensing
abstractions and APIs ...”
“A Survey of Mobile Phone Sensing,” Lane et. al
23. Open Source Smartphone Libraries for
Computational Social Science
http://emotionsense.org
https://github.com/nlathia/SensorManager
https://github.com/nlathia/TriggerManager
https://github.com/nlathia/SensorDataManager