Braceforce: a Middleware to Enable Sensing Integration in Mobile Applications for Novice Programmers
Total Page:16
File Type:pdf, Size:1020Kb
BraceForce: A Middleware to Enable Sensing Integration in Mobile Applications for Novice Programmers Xi Zheng, Dewayne E. Perry, Christine Julien The Center for Advanced Research in Software Engineering Mobile and Pervasive Computing Lab The University of Texas at Austin [email protected],[email protected],[email protected] ABSTRACT demonstrating the feasibility of applications, the develop- Even as the use of sensor networks to support mobile ap- ment of support services such as routing protocols or energy- plications grows, our ability to seamlessly and efficiently in- saving algorithms, or on advancement of hardware platforms corporate sensor network capabilities into our mobile ap- and operating systems. Little focus has been applied to ef- plications remains astoundingly difficult. Today, accessing fective development support for applications that integrate remote sensing data and integrating this data into the adap- the capabilities of networked sensing platforms in easy to use tive behavior of a dynamic user-facing mobile application re- and extensible ways. In addition to the variety of data for- quires interacting with multiple platforms, languages, data mats, communication technologies, and programming plat- formats, and communication paradigms. We present Brace- forms a developer must tackle, mobile applications also re- Force, an open and extensible middleware that allows de- quire handling network dynamics and energy constraints. velopers to access the myriad remote sensing capabilities This paper introduces BraceForce, a middleware for mo- inherent to today's mobile computing spaces (where mo- bile application development that simplifies the development, bile devices and sensors are closely integrated) using very deployment, and debugging of mobile applications. Brace- minimal code. Further, BraceForce incorporates event- and Force targets novice developers, by which we refer to pro- model-driven data acquisition as first-class concepts to pro- grammers who have a good understanding of programming vide efficient access to sensing while retaining expressiveness in general but have limited prior experience in program- and flexibility for applications. We present the BraceForce ming sensor devices. For development, BraceForce sepa- architecture and key abstractions, describe their implemen- rates the application developer from the low-level interac- tations, and provide an empirical study using BraceForce to tions between the platform and sensors. For deployment, support mobile applications integrating sensing. BraceForce also allows the developer to connect the appli- cation to sensing assets in the deployment environment. Fi- nally, when applied to debugging tasks, BraceForce can mon- 1. INTRODUCTION itor a test environment using capabilities that may not be Developing and deploying mobile applications integrating available in the deployment environment. Architecturally, sensing involves a large amount of low-level programming BraceForce defines functional tiers that encapsulate related that requires interacting with different (often proprietary) aspects but coordinate in such a way that the tiers' deploy- data formats, languages, and operating systems. In prac- ment to particular physical assets is flexible. Different tiers tice, applications are built for specific sensor platforms with can be deployed on user-facing devices or on sensing devices little potential for portability or integration with other sen- with limited capabilities, directly addressing and leveraging sors. Debugging mobile applications that integrate with a the specific capabilities and intentions of each device. Brace- physical environment requires not only integrating the appli- Force provides auto-discovery of new sensing and computing cation with sensing but also the use of a testing harness that, assets, allowing easy integration of new capabilities into ex- at debugging time, accesses sensed data about the physical isting applications or automatic and seamless extension of a environment for the purposes of validating the actions of debugging environment. the application. Integrating sensing for mobile applications Instead of using a proprietary programming language (e.g., and debugging support in a way that is easy, flexible, and nesC [9]), supporting a single hardware platform (e.g., ODK [5]), portable is essential for supporting current mobile applica- or creating a new standard (e.g., Dandelion [19] or DASH [7]), tion development. BraceForce presents a simple Java programming interface for In general, research in this space has been focused on integrating new sensing capabilities. To add a new sensor to BraceForce, a developer just needs to implement a sim- ple sensor driver interface that provides essential commands (e.g., open, close, query) and configuration. The driver im- plementation can be specific to the particular sensor but Permission to make digital or hard copies of all or part of this work for basically translates raw data into meaningful BraceForce personal or classroom use is granted without fee provided that copies are sensor data constructs, guided by the provided BraceForce not made or distributed for profit or commercial advantage and that copies interfaces. BraceForce handles issues such as thread man- bear this notice and the full citation on the first page. To copy otherwise, to republish, to post on servers or to redistribute to lists, requires prior specific agement, networking, remote procedure call, etc. permission and/or a fee. BraceForce supports both pull- and push-based interac- Copyright 20XX ACM X-XXXXX-XX-X/XX/XX ...$15.00. tion with sensing devices. BraceForce also embraces model- communication scale of one machine, and connection mecha- driven data acquisition (MDDA) [14, 21, 22, 24, 27] to reduce nisms are among ROS components running on the same ma- energy costs of integrating sensing in mobile applications. chine; modern mobile systems require coordination among MDDA suppresses sensor readings that are predictable ac- distributed components. ROS also comes with a non-trivial cording to some a priori or learned model. BraceForce sup- learning curve. ports (i) temporal models based on previous sensor read- Arduino has gained wide popularity due to simplicity, high ings [24]; (ii) models based on underlying physics princi- degrees of usability, and the resultant enabling of rapid pro- ples [21]; (iii) models derived from applying data mining to totyping. While programming for Arduino is more straight- prior sensed data [14]; and (iv) models expressing correla- forward, programmers are still required to interact with the tions of data in space and time [27]. While the use of MDDA Arduino at a very low-level of abstraction. This does not is itself not novel to BraceForce, what is new is that Brace- allow for flexible updating and discovery of local sensing Force provides existing libraries for a few MDDA models devices. The Android Sensor Framework [1] provides a pro- and allows customized MDDA models to be plugged into the gramming interface to access hardware and software sensing framework through an extensible programming interface. components on Android. This framework is also limited in This paper describes BraceForce, from its flexible archi- its abstract capabilities; the developer is still entirely re- tecture to a prototype implementation. We directly assess sponsible for thread control and other essential concerns for BraceForce's ability to ease mobile application development accessing sensors. Further, the Android Sensor Framework through an exploratory study applied to real mobile applica- does not enable connecting to external sensors connected to tions that rely on networked sensors. BraceForce provides a the device via Bluetooth, USB or other connectivity modes. clear design contract for integrating new sensors into existing Instead, the developer must use other libraries. applications. This paper makes the concrete contributions Integrating sensing in mobile applications requires high in three areas: level abstractions to provide automatic sensor discovery and 1. Supporting mobile application developers and users flexible and efficient access to the sensor data via event- and model-driven data acquisition. BraceForce unifies access to ◦ BraceForce provides a simple and unified programming a variety of sensor platforms and provides a flexible and interface to reduce programming barriers of mobile ap- expressive programming interface with high-level program- plications that integrate sensing. ming constructs tailored to networked sensor integration. ◦ BraceForce's tiered architecture enables dynamic up- Sensor Programming Frameworks. Easing program- dates to mobile applications and their physical deploy- ming of sensor networks has received significant attention. ments without intervention by the users. Mat´e[18], for example, is a tiny virtual machine that allows 2. Supporting flexible and expressive mobile applications developers to concisely express sensor programs and cause ◦ BraceForce can be deployed to heterogeneous devices these programs to be dynamically deployed. A virtual ma- in different configurations to meet constraints of mobile chine approach is very flexible, but Mat´ecomes with the cost applications and devices. of increased complexity due to the severe and unmitigatable ◦ BraceForce supports both pull- and push-based inter- resource constraints of the target environment [12]. action with sensing devices. SensorWare [4] shares the resources of a single node among ◦ BraceForce embraces