Article Text

Download PDFPDF

Developing a smartphone ‘app’ for public health research: the example of measuring observed smoking in vehicles
  1. Vimal Patel1,
  2. Mariusz Nowostawski2,
  3. George Thomson1,
  4. Nick Wilson2,
  5. Hamish Medlin2
  1. 1Department of Public Health, University of Otago, Wellington, New Zealand
  2. 2Department of Information Science, University of Otago, Dunedin, New Zealand
  1. Correspondence to Dr George Thomson, Department of Public Health, University of Otago, Wellington, PO Box 7343, Wellington South, New Zealand; george.thomson{at}


Background We have developed manual methods to gather data on the point prevalence of observed smoking in road vehicles. To enable the widespread international collection of such data, we aimed to develop a smartphone application (app) for this work.

Methods We developed specifications for an app that described the: (1) variables that could be collected; (2) transfer of data to an online repository; (3) user interface (including visual schematics) and (4) processes to ensure the data authenticity from distant observers. The app functionality was trialled in roadside situations and the app was made publicly available.

Results The smartphone app and its accompanying website were developed, tested and released over a period of 6 months. Users (n=18) who have registered themselves (and who met authentication criteria), have reported no significant problems with this application to date (observing 20 535 vehicles as of 5 July 2012). The framework, methodology and source code for this project are now freely available online and can be easily adapted for other research purposes. The prevalence of smoking in vehicles was observed in: Poland 2.7% (95% CI 2.3% to 3.1%); Australia 1.0% (95% CI 0.7% to 1.3%); New Zealand 2.9% (95% CI 2.6% to 3.2%)—similar to results using preapp methods in 2011 (3.2%, 95% CI 3.1% to 3.3%).

Conclusions This project indicates that it can be practical and feasible for health researchers to work together with information science researchers and software developers to create smartphone apps for field research in public health. Such apps may be used to collect observational data more widely, effectively and easily than through traditional (non-electronic) methods.

Statistics from

Request Permissions

If you wish to reuse any or all of this article please use the link below which will take you to the Copyright Clearance Center’s RightsLink service. You will be able to get a quick price and instant permission to reuse the content in many different ways.


Smartphones are mobile phones with enhanced computing ability and interactivity. They are typically equipped with a high-resolution touch-screen and include a number of features such as: global positioning system (GPS), light sensor, accelerometer, gyroscope and compass. By the end of 2011, one-third of all mobile phones shipped worldwide were smartphones,1 and they are owned by at least 43% of all mobile phone subscribers in the USA.2 Applications (apps) are software programs designed to run on smartphones. They can be used to collect data and transmit it instantaneously via the internet, allowing for international studies at a low cost (compared to non-electronic methods). Additionally, the location of data collection can be quickly and accurately fixed. Systems are being developed to use smartphones for rigorous data collection from distant, relatively untrained observers for a wide range of science domains.3–5

We have developed and refined manual (non-electronic) methods to gather data on the point prevalence of observed smoking in road vehicles. The methods used observation sites with high traffic flows, low traffic speeds and good visibility of vehicle occupants. Observers used a mechanical counter to count the total number of vehicles that fitted the sample frame (regardless of whether smoking was observed or not). They recorded, for vehicles with smoking, the presence of other adults and of children on a preformatted data sheet.6 ,7 In the second project, we observed 149 886 vehicles, with a mean point prevalence of smoking in vehicles of 3.2%. Of those vehicles with smoking, 4.1% had children present.7

The benefits of such data include: (i) providing an objective indicator of exposure to secondhand smoke in confined spaces, as vehicles are uniquely confined and ‘private’ but also publicly observable and (ii) the ability to collect large amounts of data relatively quickly (eg, over 900 events observed per hour).

However, limitations in the existing data on observed smoking in vehicles include that it has been explored in few published studies (as of December 2012). These include two in the same setting (Wellington, New Zealand6 ,7) one in Veneto, Northern Italy,8 and one in Barcelona, Spain.9 Given growing international interest in legislating against smoking in vehicles (and the need to evaluate such laws when they are passed), it is desirable to improve on time-consuming and fragmented manual methods of data collection. Hence, we describe here the development of a smartphone app and an accompanying website to enable ongoing data collection of observed smoking in vehicles, and consider its wider applicability to public health research. Our project aims were: (1) To develop a free open-source application (app) to enable ongoing data collection of observed smoking in vehicles by many observers internationally; (2) to briefly describe the development of this app and an accompanying website and (3) to make the framework and methodology freely available, so that the technology can be used for other research purposes.


A group of three health researchers developed the initial specification and processes for the app and website. These described the planned functions and activities, including the: (1) variables that the app would collect; (2) transfer of data from the app to an online repository; (3) user interface of the app (this included visual schematics of the app) and (4) processes to ensure the authenticity of collected.

The group then contacted commercial and other software developers, not only to obtain time and cost estimates for the project, but also to understand the development processes involved. The development process (as outlined by a software developer) involved considerable dialogue between the developer and the group. It included detailing the processes for app and website development, consultation to produce work specifications, making requested changes to the specifications, the initial development of an app on a single smartphone platform, tests by the group of the app, changes or additions of features using the group feedback, a revision of the app and development of a website, further tests by the group and then the creation of apps for the targeted smartphone platforms (eg, iOS, Android, Blackberry, Palm and Symbian operating systems).

A decision was made for the software development to be conducted as a University of Otago (UoO) ‘summer student’ project (funded in September 2011). The research and development work has been conducted by two UoO research teams in Dunedin (an information scientist and a software development student) and Wellington (health researchers) in New Zealand, that are over 500 km apart. Owing to difficulties and costs in arranging face-to-face communication between the research teams, the project was managed and coordinated through a variety of telephone calls, online video calls and emails. The UoO software developer was provided with the health research group's initial specifications for the mobile app, together with the planned development processes as outlined above.

We then agreed on project specifications that were amended to better suit the technical expertise of the software developer and the time constraints of the summer studentship (400 h). Based on these specifications, the developers provided an initial, functioning version of the app (sent online) for an Android smartphone. Initial testing of the mobile app was conducted concurrently in Dunedin and Wellington.

One researcher (VP) then trialled the app (by using it to collect data on observed smoking in vehicles from the roadside) and provided feedback to the developers. The feedback focused on the app functionality and the experience of using the app. VP assisted with some of the design and user interaction elements of the project, by designing visual schematics for the app (see figures 15).

Figure 1

‘Home screen’ for the app. From top to bottom, the four buttons are: (1) record new data (leads to figure 2); (2) stored data (leads to figure 3); (3) upload data—sends collected data via the internet and (4) preferences (leads to figure 4).

Figure 2

Data collection screens.

Figure 3

Stored data screen. From top to bottom, the four buttons provide options to: (1) email selected; (2) email all; (3) delete selected or (4) delete all data observation periods.

Figure 4

Preferences screen. From top to bottom, this screen shows various options for data recording: (1) view instructions (leads to ‘figure 5’ page); (2) activate either left or right handed data collection modes; (3) turns button press sounds either off or on; (4) enter user account details and (5) provide feedback (which is sent to the app developers).

Figure 5

Instructions and guidelines for data collection.

At least six further iterations of the app were trialled, with subsequent iterations incorporating feedback (provided by both the health research group and the software developers) on previous versions. The initial version (V.1.1) of the mobile app was further trialled by a number of researchers in Dunedin, to collect usage statistics and fine tune the internal application architecture. The first public release (V.1.2) has been uploaded to the Android Market (currently called Google Play) upon completion of the summer studentship project in January 2012. The development of the website was beyond the scope of the summer scholarship and has been developed after the mobile app was already operational. The versioning of the website follows the protocols and versioning of the mobile app. The initial tests of the website user interface and functionality has involved consultation with, and verification by, a Geospatial researcher from UoO, Antoni Moore, and an artificial intelligence collaborator, Adrian Pearou.


The resulting app

Creation of the app was a relatively smooth process with no major problems encountered. The main screens for the final app are shown in figures 15. Figure 1 shows the ‘home screen’ (equivalent to the homepage on a website).

The functions of the six buttons viewable in data collecting mode as seen in the portrait (left) version of figure 2 are:

  • On/off (top left): starts/ends the observation period.

  • Question mark (top right): provides the observation protocol (leads to figure 5).

  • Four buttons to record data:

    • No smoking (top centre large image): pressed upon observing a moving vehicle in which there is no smoking.

    • No other occupants (bottom left image of single person): pressed upon observing a vehicle in which smoking occurs and there are no other occupants present.

    • Other adults (bottom middle image of three people): pressed upon observing a vehicle in which smoking occurs in the presence of one or more other adult occupants (but no children).

    • Child ≤12 years of age (bottom right image of infant): pressed upon observing a vehicle in which smoking occurs in the presence of one or more children (there can be other adults as well).

Summaries of collected data can be viewed on the screen as in figure 3.

Portrait and landscape modes for data collection are configurable by adjusting the orientation in which the smartphone is held. Additionally, landscape mode can be configured in either right or left-handed versions (in the Preferences screen; see figure 4), which assign the three small circular buttons to the hand that is assumed to have the greatest dexterity. The function of the buttons is described below.

A ‘click’ sound is played when data recording buttons are tapped (pressed and then released), to help minimise unintentional button presses (though this function can be turned off). When data recording buttons are held for 2 s, an option is given to subtract one observation. The ‘instructions’ screen is shown in figure 5.

Access to the app and dissemination

The final app (to record data on smoking in vehicles) for Android smartphones can now be freely downloaded at: This is best done from the smartphone, by visiting the online ‘Android Marketplace’ but can also be done via a computer if a user is logged in with their Google Android account. Once installed, a username and password need to be entered in ‘Account Details’ from the preferences menu. Dissemination of the app has been limited, and it was initially given to a few contacts. In May 2012 the access for the app was notified to the Australian ‘TCN’ tobacco control email list and to the New Zealand ‘Smokefree 2025’ email list.

Data authentication and security

To ensure data authenticity (by distant and/or unknown observers), we planned to limit the usage of the app to members of a trusted, third-party website. However, this was found to be unfeasible for technical reasons. Therefore, we developed a website ( to accompany the app. For observers to send data to the website, they must: (1) register at the website (and supply a username, password and credentials including their affiliation details); (2) have their registration authenticated and (3) enter their username and password into ‘Account Details’ on the Preferences screen.

The passwords are chosen by participants and we encourage longer, not easily crackable passwords. The passwords are not stored or transferred in plain text (in a direct form) but only in a hashed form. Only authorised participants are able to transfer the collected data to the server, and each data transfer is authenticated by the ‘handshake protocol’ between the mobile app and the TobaccoFree web server. Each data entry is logged with the appropriate timestamp, GPS coordinates and unique device identification.

Unregistered/unauthenticated users are still able to collect data for their own purposes, but they are not able to upload data to the server. Each participant is manually screened and we distinguish two groups of participants: ‘trusted’, and ‘others’. Trusted participants are research team members or direct apprentices of the research team (students and coworkers). Others are potential unknown participants. Currently, of 18 participants, all have been classified to the ‘trusted’ group. Obviously, this is not a scalable solution to millions of participants, and we are working on statistical analysis of the data traces to automatically identify inconsistent and incorrect data entries.

Data transfer and storage

Data transfers are authenticated by a hashed version of the user password and are therefore hard to be imitated by rogue applications trying to contaminate the observation data. Entering bogus data manually and storing it on the server is possible, but we deal with it in a two-fold process at the moment. First, we manually screen participants to ensure their trustworthiness. With the current number of 66 total, and 18 active participants this is a manageable task. Authenticated users are able to send data to the website by connecting to the internet, using either a cellular data network or a wireless network (WiFi). Once sent, data are automatically stored and displayed on the website.

Second, we manually screen data records to identify data entered by mistake, or data that has been entered while students were practicing the use of the application. Currently stored data (as of December 2012) does not contain any unverified records. The data are stored on the private research server of the University of Otago and are backed up by the Technical Support Group at the Information Science Department of University of Otago. Only research team members have direct access to the server and high security standards are maintained.

Data collection results

The results for New Zealand obtained to date (a smoking in vehicles prevalence of 2.9% for n=9885 vehicles as of 19 December, 2012) are similar to the findings of a much larger New Zealand study in 20117 (ie, 3.2% in 149 886 vehicles, 95% CI 3.1% to 3.3%). Most of the other data to date has been collected in Poland (n=8028, 2.6% smoking in vehicles prevalence) and Australia (n=4819, 1.0% smoking in vehicles prevalence). It should be noted that cross-country, cross-site or cross-period comparisons would ideally adjust for vehicle occupancy (how many people in vehicles) as in a previous study.7 The app and website are currently in preparation for a wider promotion and release to a broader public for participation.

Usability of the app

The app was found to be usable by members of the research team (VP, HM, MN and NW) and external volunteers who performed trials. As on 19 December, 2012, there were 66 registered and authenticated users. The data collectors at this point included 14 people external to the project and four internal to the project (the project has not yet been widely promoted). Data have been collected by all of these users, with one reported problem of transferring data to the website. One registered and authenticated user did suggest that instructions for data collection could be clearer.

Costs and development efforts

The costs of the app development were principally for software development time and skills. As of 1 May 2012, the elements of the software development were:

  • Total physical source lines of code (SLOC)=4522.

  • Development effort estimate: Person-months: 11.70 (albeit some student time as part of an educational experience).

Further development of the app

At the website, there is a link to a technical website (see: This website contains the open-sourced code for the app (computer code in the form of text that constitutes the app, and from which the app can be ‘reconstituted’). The code is released to the public under the Apache Open Source Licence V.2. Thus, the source code can be used as the basis for further refinements to the existing app, or to modify the app for other usages (eg, other observational data such as observed mobile phone use). Currently, both, Android and iPhone (iOS) versions are supported, and other mobile platforms are planned. The entire backend and website are available for further extensions and could potentially be used for other, similar crowdsourcing projects.


This project indicates that it can be practical and feasible for health researchers (without software development skills) to work with software developers to create apps as data collection tools for public health related field work.

Quality of the method and results

While we were fortunate to have the software development of this project incorporated into a ‘summer student’ project with university staff help for supervision and website development, the alternative of employing commercial software developers could also be considered. It may have been quicker to work with commercial developers, who may have been able to allocate their entire workload to the project. It may also have been useful to have received input from relevant professionals with extensive and particular experience in developing the design and user experience of smartphone apps. Against these potential benefits, commercial developers are likely to be more expensive, and less willing to make the software code developed open-source.

Additionally, certain aspects of the software development arrangement with a commercial software developer are then as per needs to be handled by the health researchers themselves. These include aspects of user authentication, management of data credibility and the internal representations of the data structures. There are also further issues such as future refinements which address open research questions, such as verifying and ranking the credibility and accuracy of data recording, and assessing observer honesty/bias.

To ensure the authenticity of collected data, we planned to integrate our app with a trusted third-party website. However, this was not feasible, so we developed our own website to provide this authentication functionality at a relatively late stage in the overall project. While this latter method is perfectly functional and ultimately more accessible (to potential data collectors), in hindsight it would have been prudent to determine whether integration into the third-party website was possible at a much earlier stage of the development process.

There are a number of refinements which may improve the quality of data collection by users of the app. Smoking could be defined as one or more people in a vehicle holding a cigarette, pipe or cigar in their hand or mouth. Pairs of observers could work together, and test the interobserver variation in different settings (though previous work suggests high κ scores with low interobserver variation6 ,7).

Implications for research and further research

This study indicates that the development of smartphone apps may be a practical avenue to facilitate and/or improve the collection of standard data over a wide range of settings and different data collectors. The data collected in the first few months of the use of this app indicates the feasibility of its widespread use to collect observational data on the prevalence of smoking in vehicles. An extension of this type of app could be for collecting observational data on smoking in other settings.10–12 By making the framework and methodology freely available online, we hope to encourage the use of this technology for other research purposes.

Using an app to collect observational data may provide greater efficiency than traditional (non-electronic) methods. In particular, standardised data collected by many distant observers can be transmitted instantaneously to a single online repository. Apps may enable improvements in the ease of effective data gathering and the security of direct transmission to databases from remote entry points. Besides observational data, they could be used for questionnaires and other research tools.13 In this case, there is the potential for outsourcing data collection to screened volunteers. The use of the app may also help ensure that data recording is more accurate than manual methods.

The three main areas for further research for this particular app are: making sure that the data are collected reliably (unknown observers are not cheating the system); making sure that the models for the occurrence of smoking in vehicles follow some assumed Poisson distribution with consideration of uncertainty; and ensuring that limitations are appropriately reported in any reports of the data obtained.

A further refinement could be to include instruction on the training and testing of observers (eg, through an online video tutorial), to reduce observer error, and to provide measures of interobserver variation. For our particular observations, the most subjective aspect of the observation is the judgement of whether or not the observed children are aged 12 years or younger. So, for instance, information could be included on improving the accuracy of observers by training with photos of youth of known ages.

In the case of data collection on observed smoking in vehicles in public settings, the ethical issues (data or observer safety) appear relatively minimal to us. This is given the lack of identifying data collected, and the low likelihood that observer-observed interactions will occur (zero to date with our two previous studies in New Zealand).6 ,7 Furthermore, the data collection in this case relates to an important public health issue, where improving interventions such as campaigns and laws can help reduce the harm from secondhand smoke exposure to non-smoking adults and children. Nevertheless, there are some situations (eg, counting smokers in hospitality venues) where it may be necessary to be more mindful of issues around ethics and observer safety.12 Ethical approval from national bodies may be appropriate for some types of observational data collection. It would be also ideal if there are systems developed that allow for international bodies to provide ethical oversight for such international data collection systems.

More effective and efficient data collection methods may enable wider, quicker, more accurate and cheaper research around policy interventions, such as before and after law changes and publicity campaigns. Particular examples include smokefree policies and tobacco price increases. The effectiveness of bans on cell phone use while driving could be monitored by roadside observers with apps such as this—with very little modification.

What is already known on this subject

  • There is some literature on studies that use smartphones to collect research data from distant observers, but little on the interface between researchers and smartphone application (app) software developers.

  • Manual (non-electronic) methods have been used to collect observational data on smoking in vehicles, but these have limitations.

What this study adds

  • It can be practical and feasible for software-illiterate researchers to work with software developers to create apps that are research tools.

  • A publically accessible infrastructure and framework for collecting data on smoking in vehicles is now operating. In this case, there is a potential for outsourcing data collection to screened volunteers.

  • Such apps may help accurate health research data recording by reducing data transfer steps, and can quickly transmit data from many remote international locations to a centralised website.


Initial tests and consultations have been provided by volunteers: Adrian Perreau de Pinninck, a collaborator from Barcelona, Spain and by Antoni Moore, senior researcher in GeoSpatial Information Systems, University of Otago, Dunedin, A considerable amount of feedback and comments have been provided by Android interest group and students under the supervision of Dr Dariusz Krol from the University of Technology, Wroclaw, Poland.



  • Contributors VP conceived of the project and was the main public health worker on it, including schematics and testing. He helped in writing the initial draft. MN was the main organiser on the software development, and developed and ran the website. He participated in all drafts. GT had overall responsibility for the project, participated in all drafts, and wrote the final one. NW helped in planning the project, has conducted the tests and participated in all drafts. HM was the main worker on the app software development.

  • Funding This work was supported by salary costs for George Thomson and Vimal Patel from The Asthma Foundation of New Zealand. Software development was provided by Hamish Medlin (funded by summer scholarship from University of Otago) and Mariusz Nowostawski (funded by Information Science Department, University of Otago).

  • Competing interests None.

  • Provenance and peer review Not commissioned; externally peer reviewed.

  • Data sharing statement There is a link to a technical website (see: This website contains the open-sourced code for the app (computer code in the form of text that constitutes the app, and from which the app can be ‘reconstituted’). The code is released to the public under the Apache Open Source Licence V.2. Thus, the source code can be used as the basis for further refinements to the existing app, or to modify the app for other usages (eg, other observational data such as observed mobile phone use).