Code In The Air

Simplifying sensing and coordination tasks on smartphones

Smartphones now are equipped with a variety of sensors including inertial sensors (accelerometers and gyroscopes) and multiple position sensors (GPS, Wi-Fi, and cellular radios). These powerful capabilities have made smartphones an attractive platform for tasking applications. Tasking applications are rapid developing mobile applications which process data from multiple sensors continuously to determine user’s context (such as location or activity) and take certain actions based on pre-defined conditions. Examples of such applications include

  • location-based reminders
  • notifying when friends are nearby
  • changing the ring-mode of a phone automatically depending on the location
  • automatically tracking and storing movement tracks when driving

However, today, developing tasking applications is non-trivial for two reasons: poor abstractions and poor programming support. We address these shortcomings through Code In The Air (CITA), a system that simplifies the development of tasking applications. CITA achieves this by providing an activity composition framework and a tasking execution framework that allows developers and end-users to easily write and compose tasks.

Technical Info

Read our papers if you are interested in more details:

  1. CITA at HotMobile 2012
  2. CITA demo at MobiSys 2012
  3. CITA demo at SenSys 2010

CITA architecture

CITA users can create tasks by writing only server-side JavaScript code. The execution framework will automatically divide these tasks into sub-tasks and distribute them among multiple devices or servers. The following CITA script expresses the multi-device application “Alice would like to be alerted whenever Bob leaves his workplace.”

// Alert Alice when Bob leaves his workplace
alice = getDevice('Alice', 'Phone');
bob = getDevice('Bob', 'Phone');
bob.registerActivityCallback('leavePlace(work)', 'trueAction', null);
function trueAction(event) {
   alice.alert('Bob left work');

Background Features

The tasking framework allows developers to write task scripts, compiles them into server-side and mobile code, and manages the task execution run-time on mobile devices. As shown above, CITA provides a JavaScript interface in which developers can manipulate different phone devices as objects within a single program. The CITA backend automatically partitions the code, deals with device coordination, and efficiently executes code on the devices.

The activity layer raises the abstraction for tasks from “sensor data hacking” to “activity composition” by providing extensible modules for higher-level activities (isBiking, isDriving, isOutside, enterPlace, leavePlace, and many more). The activity layer provides accurate, energy-efficient activity recognition.

The efficient push communication service improves on the energy and load shortcomings of existing systems like the iOS and Android push services.