Logger _ An android app

As part of my dissertation for the course MRes Advanced Spatial Analysis at CASA, UCL, I am running a series of experiments on pedestrian movement in the city. The intention is to find out how the street environment affects the perception of space. During the experiments, the participants have to walk a small route in central London. The route is carefully chosen, in order to contain a number of different street elements and attributes, to see how people react to them, and how they picture them in their minds. That is, what effect different street elements (from height of buildings and pathway width to obstacles on the pavement and different kind of crossings). During the experiments, the participants also have to wear an EEG device (a modified version of the Emotiv headset) that records their brain activity. In the end of the research the EEG collected data will be matched to the street attributes.
These experiments are designed along the lines of the experiments Panos Mavros, PhD student at CASA, UCL has designed. So, in this case, any research and experiments described here will be referring to both experiments.
The EEG headset records timestamped brain activity. In order to map these data to the route the participant follows, we obviously needed a GPS recording device. Such a device is a smartphone, with the corresponding application installed. But this did not provide us with all the information we wanted. We also needed an application that would record elements of the route, so that we could add these, too, in the analysis. Such an application is People Watcher, developed in 2012 by N.S.C Dalton. People Watcher, however, only records timestamped “events”. “Events”, meaning different kind of actions that happen during the route. This is because People Watcher, as quoted on its website, is an “application for psychologists and architects to enable them to perform building usability experiments.”. This means that it is designed for indoors/building experiments were a GPS would not work with the desired accuracy, consequently there is no GPS logging. Even though we initially used this application to record route events, it proved complicated in the end. we had to merge three different datasets based on their timestamps, but since their recording frequency was not the same, a series of “mapping” steps had to be followed that delayed the procedure and raised the error-likelihood. There was also another problem, that People Watcher did not record speed, and had only a limited number of “Events” we could add.
In the light of these deficiencies, we decided to build our own application that would record all the elements we needed to record for the experiment routes. This app is “Logger”, and it released as an alpha version, meaning that there is more to be added to it in the future, in terms of better graphics and some functionality issues which will eb described later.
While “Logger” is running, it is recording every second the phone’s (the user’s) location, speed, GPS recording accuracy, the altitude, the current time in unix epoch time and in human readable format. It also offers a list of 8 “event” options, these being “Instructions/Talk”, “Pause”, “Obstacle”, “Looks Around”, “Start Walking”, “Hesitates”, “Controlled Crossing”, “Uncontrolled Crossing”. These events depict the needs of our research. Brain activity data are influenced by body activity (thus “Pause” and “Start Walking”), talking (thus we need to know when the participant talks or listens to instrucstions), and we want to correlate any possible peaks with obstacles. We also want to see the effect each type of crossing has to the pedestrian.

Technical information
The application is developed in the Android mode of processing, using a number of java and android libraries.
The code is posted on my github page, along with all data that is used and also the Android Manifest of the application. Any change you do or any feature you add, make sure you also add the corresponding permissions.
The application needs some improvement. You can find here the current .apk file that can be installed on any android device.
All this data is recorded in a .csv file named “Log.csv” which is saved in the folder DCIM where the camera pictures are located in the SD card of the phone. This folder was chosen due to easy access to it. If you prefer a different file, you can change the Export directory in the code.
The application currently does not run in the background. It needs to be open and in the foreground to record data every second. That means that if the screen turns off (if the phone sleeps) the application stops recording. When the screen lights up again and the application is in the foreground, it starts writing data again from where it left off. This means that any continuous data (timestamps and location) will have a gap in your data. A future improvement will be to have the application running in the background.
To create the file, the application needs to be quitted by the “close” button, which closes the PrintWriter that is used to create the .csv file. The closing action is confirmed through a list selection with two options, “quit” and “don’t quit”. I intend, in the future, to add a pop up that will be confirming the quitting of the application.
The application currently gives feedback in two ways. It vibrates when an event is chosen and it shows the seconds that have elapsed since the launching of it. I intend to also have a toast appearing showing the option (event) selected.
In the future I intend to improve the graphics, in a way that the buttons have a larger font.
I will also add a menu, from which the user will be able to choose the “event” names and also the folder to save the data in. The names, now, are read from a .csv file named “EventList.csv” in the “data” folder of the application. This file can be modified or replaced by a different set of 8 “event” names.

An example of plotted data
The .csv file “Logger” produces can be read and represented in various ways. The first representation attempted was the spatial one, omitting temporal/movement information. For this representation .R was used. It is plotting the events on a map, each event a different shape.
You can find the code for the LoggerPlot in my github page. Below is the plot of one route.

This is a map showing the events that Logger records, as plotted by LoggerPlot.

This is a map showing the events that Logger records, as plotted by LoggerPlot.


About Katerina

Katerina is a Google Developer Expert for Angular and a software engineer, focused on the web front end. Her projects focus on interactivity, web maps and new technologies. She also likes to mix and match web APIs, experimenting with device sensors, and she open sources her code for the general good. She speaks at international conferences and co-organizes the Angular Athens meetup. She is also involved with supporting diversity in the community, speaking about it and helping the ngGirls whenever she can. Katerina is obsessed with sharing knowledge and spreading the word about things she loves, which is all that has to do with web. She is indigenous to the internet, and she loves web development. So much that she does not understand the distinction between work and life sometimes. Or so her friends say. She lives with her Maine Coon in Athens, Greece.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: