#LyX 1.6.5 created this file. For more info see http://www.lyx.org/
\lyxformat 345
\begin_document
\begin_header
\textclass paper
\use_default_options true
\language english
\inputencoding auto
\font_roman default
\font_sans default
\font_typewriter default
\font_default_family default
\font_sc false
\font_osf false
\font_sf_scale 100
\font_tt_scale 100

\graphics default
\paperfontsize default
\spacing single
\use_hyperref false
\papersize a4paper
\use_geometry false
\use_amsmath 1
\use_esint 1
\cite_engine basic
\use_bibtopic false
\paperorientation portrait
\secnumdepth 3
\tocdepth 2
\paragraph_separation skip
\defskip medskip
\quotes_language english
\papercolumns 1
\papersides 1
\paperpagestyle default
\tracking_changes false
\output_changes false
\author "" 
\author "" 
\end_header

\begin_body

\begin_layout Title
Context-Aware API for Android Devices
\end_layout

\begin_layout Author
Chris Smith
\begin_inset Newline newline
\end_inset

Supervisor: Naranker Dulay
\end_layout

\begin_layout Date
Summer 2010
\end_layout

\begin_layout Standard
\begin_inset Newpage pagebreak
\end_inset


\end_layout

\begin_layout Abstract
In recent years location-based services have seen a dramatic increase in
 adoption, and all modern smartphone platforms have integrated services
 to facilitate the creation location-aware applications.
 Such applications enhance the experience of users, using location to modify
 content or alter the behaviour of the application to better suit the circumstan
ces.
\end_layout

\begin_layout Abstract
The product of this project is a 
\emph on
context
\emph default
-aware API for the Android platform.
 This allows applications to augment the already available location data
 with extra 
\emph on
context
\emph default
 about the user's situation - primarily their current activity.
 It also develops an algorithm for recognising 
\emph on
places
\emph default
 which are relevant to the user, and monitoring which activities are performed
 in 
\emph on
journeys
\emph default
 between those places, thus enabling predictions of the user's likely destinatio
n based on their activity.
\end_layout

\begin_layout Abstract
Research into other methods of annotating context was conducted, and it
 was found that most potential sources of context information either produced
 little or no information, or were too battery-draining to perform in a
 real world environment with current technology.
 Much effort was placed into optimising the API to have as small effect
 on battery life as possible.
\end_layout

\begin_layout Abstract
A context-aware API was successfully produced, along with a collection of
 applications which use the API in order to demonstrate its features or
 provide example use cases.
\end_layout

\begin_layout Standard
\begin_inset Newpage pagebreak
\end_inset


\end_layout

\begin_layout LyX-Code
\begin_inset CommandInset toc
LatexCommand tableofcontents

\end_inset


\begin_inset Newpage pagebreak
\end_inset


\end_layout

\begin_layout Standard
\begin_inset FloatList figure

\end_inset


\end_layout

\begin_layout Standard
\begin_inset FloatList table

\end_inset


\end_layout

\begin_layout LyX-Code
\begin_inset Newpage pagebreak
\end_inset


\end_layout

\begin_layout Part
Introduction
\end_layout

\begin_layout Section
Proposal
\end_layout

\begin_layout Quote
Objective: to create an API for android applications to query the user's
 [probable] current activity, and to consider and implement possible uses
 for this API in existing applications.
 The user's activity would be determined based on available sensor and ambient
 data (e.g.
 time, location, orientation/movement of device, background noises, camera
 image, in-range bluetooth devices, etc), previous behaviour of the user,
 and possibly behaviour of other users which has been shared between devices.
\end_layout

\begin_layout Quote
Motivation: Activity-awareness would be a major step forward in making mobile
 devices better able to adapt to what the user wants to do with them.
 The latest generation of mobile phones have made location-aware applications
 quite ubiquitous, and a lot of these could be further enhanced by making
 them activity aware.
 For example, an application which lists businesses in a certain area could
 not only know the search area (by merit of being location-aware), but could
 also make an educated guess at what you're looking for (e.g.
 the activity API may suggest the user is likely to be going to lunch, so
 the application could initially show nearby eating establishments instead
 of requiring the user to search for them).
\end_layout

\begin_layout Quote
Challenges/issues: primary challenge is developing an algorithm which can
 make reasonable estimates as to the user's activity (or attempting and
 then justifying why such an algorithm is not feasible, and investigating
 requirements or alternatives), and would form the bulk of the project.
 Sub-challenges within this include: researching/implementing machine learning
 techniques so the algorithm can take previous behaviour into account, processin
g data from 'messy' inputs such as mic/camera, and designing an API that
 would enable third-party app developers to easily make their applications
 activity aware.
\end_layout

\begin_layout Quote
Approach: data from sensors would need to be processed (e.g.
 mic input processed into a figure for ambient noise level in dB).
 The combination of this processed data would then need to be fed into an
 algorithm (possibly a neural network) to determine likelihood of various
 activities.
 There would need to be some mechanism for users to correct or train the
 system (at least initially), and it's possible that this data could then
 be shared to other users of the api/application.
\end_layout

\begin_layout Section
Aims and Motivation
\end_layout

\begin_layout Standard
The primary aim of this project is to create an application for the Android
 platform that can sense the user's context in some fashion.
 This application will have a public interface which will allow other applicatio
ns written by third party developers to read and receive updates about the
 user's context.
\end_layout

\begin_layout Standard
The ease of access to location aware services in modern smartphone platforms
 has lead to a surge in the number of applications which improve their utility
 or behaviour by integrating location information.
 It stands to reason that if additional context information were available,
 developers would be able to take advantage of this and further improve
 the utility of their applications.
 This, in turn, would increase the productivity of the end-user.
\end_layout

\begin_layout Standard
As discussed in
\begin_inset CommandInset ref
LatexCommand ref
reference "par:Background"

\end_inset

, a large amount of existing research has been done on context-aware devices,
 and specifically on activity-aware systems.
 There have also been some limited implementations for smartphones.
 Unfortunately, the end product of most of this research is not suitable
 for deployment or use in practical, every-day circumstances.
 This project aims to produce a working prototype which can be used on a
 day-to-day basis on an Android smartphone without significantly degrading
 performance.
\end_layout

\begin_layout Section
Issues and challenges
\end_layout

\begin_layout Standard
One of the main challenges for this project will be accomplishing accurate
 and useful context-awareness without significantly hindering the battery
 life or performance of a typical device.
 Existing algorithms tend to be extremely verbose, sometimes performing
 upwards of thousands of calculations per classification; on a mobile device
 this is likely to severely cripple battery life.
\end_layout

\begin_layout Standard
The problem of battery life affects all areas of the project - from how
 often data is collected, how the data is then analysed, and which sources
 of potential data are consulted.
 A large amount of time will need to be spent analysing the various potential
 data sources and establishing whether or not the cost in consulting them
 is worth the reduction in battery lifetime and any gain in the reliability
 or accuracy of context information.
\end_layout

\begin_layout Standard
The aim of the application is to provide the context data to third-party
 applications, so another challenge will be designing an appropriate interface
 which will allow applications to query and receive updates about the user's
 context.
 Consideration will have to be given as to any security measures (such as
 access control) which may need to be applied in order to protect user privacy.
\end_layout

\begin_layout Section
Structure
\end_layout

\begin_layout Standard
Part 
\begin_inset CommandInset ref
LatexCommand prettyref
reference "par:Background"

\end_inset

 summarises some of the current work in the field of context-aware systems
 and activity inference.
 Part 
\begin_inset CommandInset ref
LatexCommand prettyref
reference "par:Activity-classification"

\end_inset

 explains in detail the techniques developed to classify user activity from
 accelerometer data, applications developed to facilitate this, and analyses
 data collected from users to determine the accuracy of the activity classificat
ion algorithms.
 Parts 
\begin_inset CommandInset ref
LatexCommand prettyref
reference "par:Other-sensors"

\end_inset

 and 
\begin_inset CommandInset ref
LatexCommand prettyref
reference "par:Places"

\end_inset

 deal with potential context information from other sensors such as microphones
 and cameras, and the contextual value of the user's location, and how interesti
ng places can be inferred.
\end_layout

\begin_layout Standard
Part 
\begin_inset CommandInset ref
LatexCommand prettyref
reference "par:The-Context-Analyser"

\end_inset

 introduces the Context Analyser, the primary output of this proejct, and
 its suite of related applications.
 The project is evaluated in part 
\begin_inset CommandInset ref
LatexCommand prettyref
reference "par:Evaluation"

\end_inset

 and conclusions drawn and future work considered in part 
\begin_inset CommandInset ref
LatexCommand prettyref
reference "par:Conclusion"

\end_inset

.
\end_layout

\begin_layout Standard
\begin_inset Newpage pagebreak
\end_inset


\end_layout

\begin_layout Part
Background
\begin_inset CommandInset label
LatexCommand label
name "par:Background"

\end_inset


\end_layout

\begin_layout Standard
Context- or Activity-Aware devices is an area currently under lots of research.
 There are many and varied applications of activity-aware devices, ranging
 from personal fitness and healthcare to training factory workers or merely
 playing music.
\end_layout

\begin_layout Standard
While this research is going on, there has been a huge expansion in the
 ownership, use and power of mobile telephones.
 Mobile telephones are so ubiquitous and now come with such a large sensor
 platform that they are the obvious choice for implementing activity-aware
 technologies for use in day-to-day life.
\end_layout

\begin_layout Standard
This project aims to make a context-aware API available on an open mobile
 platform, which will enable developers to start adding context-aware functional
ity to their applications without the extremely large overhead of writing
 a logger and classifier themselves, or re-engineering the application to
 use an existing context-aware framework if one is available.
\end_layout

\begin_layout Section
Applications
\end_layout

\begin_layout Standard
There are many documented applications of activity-aware systems, and current
 research efforts which bring the technology to mobile telephones will only
 serve to lengthen this list.
\end_layout

\begin_layout Standard
The canonical example for activity-awareness, especially on mobile telephones,
 is modeling the user's 
\begin_inset Quotes eld
\end_inset

interruptibility
\begin_inset Quotes erd
\end_inset


\begin_inset CommandInset citation
LatexCommand cite
key "Siewiorek2003,Raento2005"

\end_inset

.
 This allows the software to know whether it's appropriate (or "polite")
 to disturb the user, and can advise the user's contacts when they are busy.
 It can also be used to create a 
\begin_inset Quotes eld
\end_inset

smart answering machine
\begin_inset Quotes erd
\end_inset

 
\begin_inset CommandInset citation
LatexCommand cite
key "Hudson2003"

\end_inset

 which can selectively direct calls straight to an answering machine if
 the user is engaged in an "uninterpretable" activity and the call does
 not appear to be important.
 These allow the user's mobile telephone to better approximate human behaviour
 - when approaching someone in person it is normally quite easy to determine
 whether it would be polite or necessary to disturb them, based on their
 demeanour, activity, and the urgency of your request; when picking up the
 telephone it is not possible at all without assistance from an activity-aware
 system.
\end_layout

\begin_layout Standard
The current implementations of these ideas have several problems, however.
 The more interesting research 
\begin_inset CommandInset citation
LatexCommand cite
key "Hudson2003"

\end_inset

 requires a static camera fixed in an office to observe user behaviour,
 instead of implementing it directly on a telephone, which obviously constrains
 its usefulness.
 Of the two solutions actually targeted at mobile telephones, one
\begin_inset CommandInset citation
LatexCommand cite
key "Siewiorek2003"

\end_inset

 requires bulky custom hardware which the user must carry on their belt,
 and the other 
\begin_inset CommandInset citation
LatexCommand cite
key "Raento2005"

\end_inset

does not expose an API to other applications and only surfaces the context-aware
 functionality in two small applications whose focus is on social interaction
 rather than improving the user's experience of the telephone locally.
 This project will aim to bring the ideas of these to generic hardware (an
 Android mobile telephone), and to provide an API which other applications
 can harness.
\end_layout

\begin_layout Standard
One use particularly suitable for mobile phones is dynamic adaptation of
 the device's settings based on the user's current activity and context
\begin_inset CommandInset citation
LatexCommand cite
key "Schmidt1999"

\end_inset

.
 When a user is walking the device can dynamically increase the font size
 to make it easier to read with an unsteady hand, and correspondingly decrease
 it when the user is stationary.
 In a similar fashion, the brightness of the backlight can be altered based
 on the ambient light level, and the ringer volume altered according to
 the noise level.
 Unfortunately this research did not progress beyond a feasibility study
 and was implemented on a Nokia 6110, which is severely outdated by today's
 standards.
 
\end_layout

\begin_layout Standard
Another popular area for activity-aware systems is in healthcare.
 Such systems can be used to monitor vulnerable people as they go about
 day to day activities to ensure that they're not in trouble - several systems
\begin_inset CommandInset citation
LatexCommand cite
key "Song2005,Maurer2006"

\end_inset

 can be used to monitor elderly persons and summon help if it is detected
 that they have fallen.
 Another healthcare application
\begin_inset CommandInset citation
LatexCommand cite
key "Tentori2008"

\end_inset

 allows nurses to remotely monitor the activities of their patients in a
 hospital ward, allowing them to respond to problems and keep up-to-date
 with their patients' well-being while not physically present.
 Activity-aware applications have also been used to try to encourage users
 to be more healthy; one novel application records the day-to-day fitness
 activities a user performs and uses this as a basis for a virtual 
\begin_inset Quotes eld
\end_inset

garden
\begin_inset Quotes erd
\end_inset

 that blossoms or wilts according to how much the user works out in a week
\begin_inset CommandInset citation
LatexCommand cite
key "Consolvo2008"

\end_inset

.
\end_layout

\begin_layout Standard
As well as monitoring activities which the user is familiar with, activity-aware
 systems can also be used to assist users in learning new activities.
 One application
\begin_inset CommandInset citation
LatexCommand cite
key "Stiefmeier2008"

\end_inset

 monitors the activities of trainee workers in a car manufacturing plant,
 and helps to provide a link between theoretical classroom-based training
 and practical work.
 The activity-aware system can offer advice to the workers that's directly
 related to the current task they're performing, and can even monitor their
 activities for compliance with procedures and give them a score afterwards.
\end_layout

\begin_layout Standard
While the research into healthcare and training applications present novel
 uses of activity-aware systems, the applications themselves are not really
 applicable to a mobile device or the scope of this project.
 The research does, however, describe the techniques used in those applications
 for activity classification and should prove useful in that respect.
\end_layout

\begin_layout Standard
Other areas of research include making activity-aware suggestions to the
 user 
\begin_inset CommandInset citation
LatexCommand cite
key "Bellotti2008"

\end_inset

, or issuing reminders or alerts based on the user's activity 
\begin_inset CommandInset citation
LatexCommand cite
key "Schilit1994"

\end_inset

.
 One example of the latter is an activity-aware system that detects when
 the user is making coffee, and plays a sound on a remote computer to alert
 thirsty coworkers to the fact.
 Sound isn't only limited to alerts, however: the 
\noun on
XPOD
\noun default

\begin_inset CommandInset citation
LatexCommand cite
key "Dornbush2005"

\end_inset

 project is an activity-aware music player, which tailors the music being
 played to the user's current activity based on their past ratings.
 This type of activity-aware device presents a much greater level of personalisa
tion than previously possible, and making this type of customisation available
 to mobile telephone users and application developers will surely result
 in many new applications.
\end_layout

\begin_layout Section
Inferring activity
\end_layout

\begin_layout Standard
There are three general phases in most context-aware systems: a sensing
 component, which reads or receives raw sensor data relating to the user's
 environment or activity; a feature extraction component, which analysis
 the sensor data and identifies a set of features from that data; and a
 classification component, which uses the extracted features to reason about
 the user's activity
\begin_inset CommandInset citation
LatexCommand cite
key "Choudhury2008"

\end_inset

.
 Each of these components will be expanded on below.
 Depending on the method of classification, some initial or continuous training
 may be required, and this is also considered below.
\end_layout

\begin_layout Subsection
Sensors and devices
\end_layout

\begin_layout Standard
At the basis of activity-recognition are the physical hardware sensors.
 The most commonly used sensor is the accelerometer, which outputs the accelerat
ion of the sensor
\begin_inset Foot
status collapsed

\begin_layout Plain Layout
and thus the device to which it's attached, and therefore the person using
 the device
\end_layout

\end_inset

 along a certain axis.
 There is extensive research on using accelerometers to classify activities
 such as walking 
\begin_inset CommandInset citation
LatexCommand cite
key "Mathie2004,Garakani2009"

\end_inset

 (including whether or not the subject is walking on flat ground or up and
 down stairs 
\begin_inset CommandInset citation
LatexCommand cite
key "Caros2005"

\end_inset

), running 
\begin_inset CommandInset citation
LatexCommand cite
key "Garakani2009"

\end_inset

, falling 
\begin_inset CommandInset citation
LatexCommand cite
key "Mathie2004"

\end_inset

, sitting 
\begin_inset CommandInset citation
LatexCommand cite
key "Mathie2004,Garakani2009"

\end_inset

, cycling 
\begin_inset CommandInset citation
LatexCommand cite
key "Garakani2009"

\end_inset

, etc.
\end_layout

\begin_layout Standard
Smartphones also come equipped with a microphone and GSM stack (prerequisites
 for a telephone conversation!), and commonly a camera, geolocation API
 (usually backed by GPS) and Bluetooth stack.
 With the exception of the latter two, these types of sensors are not particular
ly well explored for their use in context-aware systems at present.
 It is easy to reason how each would be useful - a microphone can reveal
 the ambient noise, which could indicate the difference between sitting
 in a library and a bar; the camera likewise can reveal the lighting conditions
 (if the device is not in a pocket or bag).
 The GSM stack can provide rough location information and also a signal
 strength to one or more cell towers; the signal strength will vary both
 with the user's proximity to the cell tower and the environment around
 them - being inside will degrade the signal more than being in open air,
 for example - so may provide vital clues to a context-aware system.
 One aspect of this project will be to research how the microphone, camera
 and GSM stack can be used to enhance existing activity classification algorithm
s.
\end_layout

\begin_layout Standard
Current research on location information and Bluetooth device proximity
 is summarised in section 
\begin_inset CommandInset ref
LatexCommand ref
reference "sec:Location-analysis"

\end_inset

 (p
\begin_inset CommandInset ref
LatexCommand pageref
reference "sec:Location-analysis"

\end_inset

) and 
\begin_inset CommandInset ref
LatexCommand ref
reference "sec:Bluetooth-1"

\end_inset

 (p
\begin_inset CommandInset ref
LatexCommand pageref
reference "sec:Bluetooth-1"

\end_inset

) respectively.
\end_layout

\begin_layout Subsection
Feature detection
\end_layout

\begin_layout Standard
It is not possible to reason directly about raw sensor inputs, so the next
 step in inferring activities is to extract useful 
\emph on
features
\emph default
 from the raw input.
 Features are usually mathematical properties of the input data, such as
 the difference between the minimum and maximum data point in a given time
 frame.
 Most classifiers use an extremely large number of features - 
\begin_inset CommandInset citation
LatexCommand citet
key "Hein2008"

\end_inset

 detect 562 different features from their inputs.
\end_layout

\begin_layout Standard
Some of the more commonly used features in activity-recognition systems
 are: mean, standard deviation, energy, entropy, correlation between axis,
 and discrete FFT coefficients
\begin_inset CommandInset citation
LatexCommand cite
key "Huynh2005"

\end_inset

.
 Obviously, not all features are of equal value.
 FFT coefficients are generally very good indicators of activity, but the
 ideal coefficients and window sizes vary depending on the exact activity
 that is being detected.
 Likewise, the choice of other features to give the best recognition rate
 varies depending on the activity being detected
\begin_inset CommandInset citation
LatexCommand cite
key "Huynh2005"

\end_inset

.
\end_layout

\begin_layout Standard
As the sensor data is received continuously, it needs to be partitioned
 somehow before features are extracted.
 Most implementations use a sliding window approach with a 50% overlap between
 windows
\begin_inset CommandInset citation
LatexCommand cite
key "Bao2004"

\end_inset

.
 A window size of 10 seconds with a 50% overlap would result in one set
 of features being computed every 5 seconds.
 The window size is normally selected to correspond to a pre-defined number
 of samples to enable fast computation of certain features - most notably
 FFTs
\begin_inset CommandInset citation
LatexCommand cite
key "Bao2004"

\end_inset

.
\end_layout

\begin_layout Standard
One challenge will be determining a set of features that are robust enough
 to perform activity analysis on, but are sufficiently inexpensive to calculate
 continually on a mobile device, where CPU speed is limited and excessive
 usage results in undesirable higher battery consumption.
\end_layout

\begin_layout Subsection
Training
\end_layout

\begin_layout Standard
In order to meaningfully classify and label activities, some kind of training
 generally needs to be performed beforehand.
 The choice of classifier affects how much offline analysis has to be done
 on the training set, and whether or not it can be adapted at run-time.
\end_layout

\begin_layout Standard
One might expect that training would best be performed in a controlled environme
nt, to reduce external influences on the user, but subjects in a laboratory
 setting are much more self-conscious about their movements, and this manifests
 itself in the data collected.
 Walking in a laboratory tends to produce acceleration data showing a consistent
 gait cycle which can be split into distinct phases, whereas walking in
 an uncontrolled setting produces data showing large fluctuations in gait
 phases and length.
 This means that classifiers trained on laboratory data may achieve a much
 lower accuracy when deployed in natural conditions
\begin_inset CommandInset citation
LatexCommand cite
key "Bao2004"

\end_inset

.
\end_layout

\begin_layout Subsection
Classification
\end_layout

\begin_layout Standard
The classification step involves feeding the features for frame into some
 kind of machine learning algorithm which can, using training data
\begin_inset Foot
status collapsed

\begin_layout Plain Layout
and any offline analysis made of that data
\end_layout

\end_inset

, determine which activity the feature-set most like represents.
 There are many different algorithms that can be used to perform the classificat
ion, some of which are discussed below.
\end_layout

\begin_layout Subsubsection
Decision trees
\end_layout

\begin_layout Standard
Decision trees are possibly one of the simplest approaches possible
\begin_inset CommandInset citation
LatexCommand cite
key "Hudson2003"

\end_inset

.
 A tree is constructed such that each node contains a test function, with
 branches for each possible discrete outcome of the function.
 This allows data to be classified with a 
\begin_inset Quotes eld
\end_inset

divide and conquer
\begin_inset Quotes erd
\end_inset

 approach.
 While high accuracy is possible in some circumstances
\begin_inset CommandInset citation
LatexCommand cite
key "Hudson2003"

\end_inset

, there are several drawbacks to decision trees: a plain decision tree has
 no way to model uncertainty - in an activity-aware system there will always
 be a degree of uncertainty as to the classification, and being able to
 measure this is an important tool.
 They also have an inductive bias which leads to a preference for the most
 general solution, and in most cases this generalisation causes many false
 results
\begin_inset CommandInset citation
LatexCommand cite
key "Shen2004"

\end_inset

.
\end_layout

\begin_layout Standard
Decision trees require the structure of the tree and the test functions
 for each node to be determined during training.
 They do not lend themselves to minor on-the-fly modifications or new activities
 that are not part of the training set.
\end_layout

\begin_layout Subsubsection
Neural networks
\end_layout

\begin_layout Standard
Neural networks are based on an extremely simplified model of the brain.
 The network consists of layers of neurons, and each neuron performs a simple
 arithmetic operation on its inputs.
 This normally consists of taking each of its inputs, multiplying it by
 a weight, and then summing all of the weighted inputs together; the resulting
 figure then becomes the neuron's output, and the input to one or more nodes
 in the next layer.
\end_layout

\begin_layout Standard
A network consists of a layer of input neurons, a layer containing one or
 more output neurons, and one or more layers of 
\begin_inset Quotes eld
\end_inset

hidden
\begin_inset Quotes erd
\end_inset

 neurons in between.
 The number of 
\begin_inset Quotes eld
\end_inset

hidden
\begin_inset Quotes erd
\end_inset

 layers, and the number of neurons within those layers must be chosen before
 training of the network begins.
 The training process will then determine the weights for each link in the
 network.
 The choice of number of layers poses a problem when designing a network,
 as too small a number can cripple the power of the network, but too large
 can cause it to be too expensive to evaluate and can possibly lead to it
 memorising erroneous data
\begin_inset CommandInset citation
LatexCommand cite
key "Dornbush2005"

\end_inset

.
\end_layout

\begin_layout Standard
Neural networks, however, do provide good accuracy and could potentially
 (although not easily) be modified on-the-fly to cope with new activities.
\end_layout

\begin_layout Subsubsection
Genetic algorithms
\end_layout

\begin_layout Standard
Genetic algorithms use the principle of natural selection to 'evolve' a
 solution to a problem.
 A set of random solutions are created, and a pre-defined fitness function
 is used to determine their relative worth.
 The best solutions are then combined together to produce the next generation
 of solutions, in a manner roughly analogous to reproduction in animals.
 Small 
\begin_inset Quotes eld
\end_inset

mutations
\begin_inset Quotes erd
\end_inset

 are also introduced into each generation to counter the effect of local
 maxima being reached.
\end_layout

\begin_layout Standard
Genetic algorithms can be combined with other techniques such as neural
 networks - the weights in the neural network can be 
\begin_inset Quotes eld
\end_inset

evolved
\begin_inset Quotes erd
\end_inset

 using genetic algorithms to create a neural network which is good as satisfying
 the fitness function.
\end_layout

\begin_layout Standard
The drawback of genetic algorithms is the need for a fitness function -
 the network will only ever be as good as the fitness function, and if you
 have a way to define what makes a good network you could in most cases
 hardcode the solution instead of evolving a network to satisfy it.
\end_layout

\begin_layout Subsubsection
Instance-based learning
\end_layout

\begin_layout Standard
Instance-based learning (IBL)
\begin_inset CommandInset citation
LatexCommand cite
key "Witten2000"

\end_inset

 algorithms are a class of 
\begin_inset Quotes eld
\end_inset

lazy
\begin_inset Quotes erd
\end_inset

 algorithms.
 They perform classification based on previously observed instances that
 have already been classified.
 There is no training required for IBLs, they're extremely adept at adapting
 to new scenarios, and they have a very low error rate
\begin_inset CommandInset citation
LatexCommand cite
key "Dornbush2005"

\end_inset

 which makes them ideal for activity-recognition.
\end_layout

\begin_layout Standard
One particular type of IBL algorithm which is frequently seen in activity-aware
 research is the K-Nearest Neighbour (KNN) algorithm
\begin_inset CommandInset citation
LatexCommand cite
key "Han2006"

\end_inset

.
 With the KNN algorithm, each sample is treated as a vector, and the distance
\begin_inset Foot
status collapsed

\begin_layout Plain Layout
the euclidean distance is usually used, but any metric will suffice
\end_layout

\end_inset

 between the sample and the existing instances is calculated.
 The sample is then classified according to the classification of the majority
 of its 
\begin_inset Formula $k$
\end_inset

 nearest neighbours.
\end_layout

\begin_layout Standard
One drawback of IBLs is that each new instance tends to be remembered for
 future use, which eventually results in large amounts of memory consumption
 and complexity when comparing distances of new samples.
 This can be partially overcome by only storing instances which would affect
 the classification of new samples
\begin_inset CommandInset citation
LatexCommand cite
key "Witten2000"

\end_inset

.
\end_layout

\begin_layout Standard
The KNN algorithm can be easily extended to support dynamic classification
 of new types of activities - if a sample is not within a certain distance
 of sufficient other samples, it can be classified as a new type of activity.
\end_layout

\begin_layout Subsubsection
Conclusion
\end_layout

\begin_layout Standard
There are numerous machine learning algorithms available and suitable for
 use in activity classification tasks.
 There has been a lot of research into their use, and all of the algorithms
 discussed have produced good results.
 Because of the lack of need for any training, however, the K-Nearest Neighbour
 algorithm appears to be the most promising for a mobile device.
 Any algorithm that needs explicit training prior to classification would
 almost certainly require a desktop application or a remote service to analyse
 the data, as it typically requires large amounts of memory and expensive
 computations.
 This either makes the application extremely cumbersome for the user (they
 have to connect their phone to a computer, transfer a file, obtain and
 run a separate application, then transfer some file back), or puts a large
 resource burden onto the distributor (having to remotely analyse all of
 the data from all users would require dedicated hardware for any more than
 a few users).
\end_layout

\begin_layout Section
Mobile telephones
\end_layout

\begin_layout Standard
It's hard to overstate the ubiquity of mobile telephones at present.
 In 2003, over a billion mobile telephones were sold - six times as many
 as the number of personal computers
\begin_inset CommandInset citation
LatexCommand cite
key "Eagle2004"

\end_inset

.
 In 2007, this same figure describes the number of cameraphones sold
\begin_inset CommandInset citation
LatexCommand cite
key "Reynolds2008"

\end_inset

, clearly representing a substantial growth in sales and advancements in
 the technology.
 In fact, mobile telephones are the fastest adopted technology in human
 history
\begin_inset CommandInset citation
LatexCommand cite
key "Eagle2004"

\end_inset

.
 This ubiquity, coupled with the fact that mobile telephones are comfortably
 carried around on a daily basis by most of their users, makes them a very
 attractive alternative to more traditional platforms used for activity-aware
 research, which typically involved bulky or inconvenient apparatus that
 was expensive to manufacture
\begin_inset CommandInset citation
LatexCommand cite
key "Schmidt2008"

\end_inset

 and made users very self-conscious.
\end_layout

\begin_layout Subsection
iPhone
\end_layout

\begin_layout Standard
There have been several published works related to activity-recognition
 on the iPhone.
 The similarity between iPhone and Android platforms means that many of
 the concepts developed for or used on the iPhone are applicable to both.
\end_layout

\begin_layout Subsubsection
iLearn
\end_layout

\begin_layout Standard

\noun on
iLearn
\noun default

\begin_inset CommandInset citation
LatexCommand cite
key "Schmidt2008"

\end_inset

 is a suite of three tools - 
\noun on
iLog
\noun default
, 
\noun on
iModel,
\noun default
 and 
\noun on
iClassify
\noun default
 - which together allow for real-time classification of low-level activities.
 
\noun on
iLog
\noun default
 is run on the user's iPhone and allows the user to specify which activity
 they will be performing.
 The application then records raw sensor data from the iPhone's three-axis
 accelerometer and 124 features computed from this data in real-time.
 The data is then stored on the device, annotated with the selected activity.
\end_layout

\begin_layout Standard
The training data collected by 
\noun on
iLog
\noun default
 is then transferred to a desktop computer where 
\noun on
iModel
\noun default
 uses a Naïve Bayesian Network (NBN) to create a model which can be used
 to classify future input.
 The choice of NBNs was based on their ability to classify a set of trial
 data correctly, and the low computational cost of classifying data once
 the model has been generated.
\end_layout

\begin_layout Standard
Once the model has been created, it is transferred back to the device where
 it is used by 
\noun on
iClassify
\noun default
.
 This provides an API for other applications, and allows them to register
 for a callback which it publishes the user's current activity to every
 second.
\end_layout

\begin_layout Standard
Unfortunately, neither the source code nor the API are published.
 The inability to run background processes on the iPhone suggests that any
 
\begin_inset Quotes eld
\end_inset

API
\begin_inset Quotes erd
\end_inset

 would have to be more like a framework where the third-party developer
 has to re-engineer their application to use the 
\noun on
iClassify
\noun default
 application as a base.
 This is undesirable as it makes it extremely difficult to adapt existing
 applications to use the activity-aware API, and is a very cumbersome way
 of providing what could be a very minor piece of functionality for the
 application.
\end_layout

\begin_layout Subsubsection
Evaluation
\end_layout

\begin_layout Standard
\begin_inset CommandInset citation
LatexCommand citet
key "Miluzzo2009"

\end_inset

 present an evaluation of the iPhone for use in 
\begin_inset Quotes eld
\end_inset

people-centric sensing applications
\begin_inset Quotes erd
\end_inset

.
 One of the major drawbacks highlighted is that the iPhone does not support
 applications which run in the background.
 This means that any application wishing to perform continuous real-time
 activity detection would need to run as a foreground process, preventing
 the user from using the device for any other function.
\end_layout

\begin_layout Standard
The research also shows that the computational compatibility of the iPhone
 is more than sufficient to perform the necessary calculations for a typical
 activity-recognising application, which suggests that any modern smart
 phone would be capable of these.
\end_layout

\begin_layout Subsubsection
Multitasking
\end_layout

\begin_layout Standard
Since the evaluation presented above was written, Apple have announced a
 new version of the iPhone OS which supports pseudo multi-tasking.
 However, this form of multi-tasking only allows a limited set of predefined
 functions to be performed, such as playing audio or monitoring location.
 This still prevents continuous real-time activity detection from taking
 place in a useful fashion.
\end_layout

\begin_layout Standard
Further, because of the homogeneous hardware and memory model employed by
 the iPhone, applications typically make assumptions about the amount of
 free memory that will be available to them.
 This prevents any real implementation of multi-tasking, as background apps
 would infringe on this fixed amount of free memory.
 It is therefore unlikely that future updates will enable true, uninhibited
 multi-tasking, as it would break compatibility with a lot of existing applicati
ons.
\end_layout

\begin_layout Subsection
Android
\end_layout

\begin_layout Standard
While the Android platform is relatively new, it is rapidly gaining market
 share on the more established mobile operating systems.
 A December 2009 survey
\begin_inset CommandInset citation
LatexCommand cite
key "ChangeWave2010"

\end_inset

 shows that 21% of respondents want their next smartphone purchase to run
 Android, a 350% increase from the same survey conducted three months prior.
 This is compared to the iPhone, which dropped 4% to 28% in the same time
 period.
 Gartner, a respected IT research firm, predicts that by 2012, Android will
 be the second most popular mobile operating system globally
\begin_inset CommandInset citation
LatexCommand cite
key "ComputerWorld2010"

\end_inset

.
\end_layout

\begin_layout Standard
In addition to its rapidly increasing popularity, the Android platform offers
 several advantages over the iPhone platform.
 Most notably is the ability to run background processes (called 
\noun on
services
\noun default
), which will allow a classifier application to run without interfering
 with the user's normal use of their mobile telephone.
 In addition, the Android OS provides access to the Bluetooth and GSM stacks,
 allowing for data from both to be used for activity detection.
\end_layout

\begin_layout Standard
The ability to run a background process will enable a proper API for sharing
 activity data with other applications, which will allow third-party developers
 to make their applications context-aware with relatively little work on
 their part.
 This is extremely desirable as it will allow rapid prototyping of applications,
 which will hopefully lead to innovative new uses of activity classification.
\end_layout

\begin_layout Standard
While it is purported
\begin_inset CommandInset citation
LatexCommand cite
key "Garakani2009"

\end_inset

 that there is research being done on bringing activity-awareness to Android
 platforms, there does not seem to be any work published on this matter
 or any applications available to support it.
 While there a small number of self-proclaimed 
\begin_inset Quotes eld
\end_inset

context-aware
\begin_inset Quotes erd
\end_inset

 applications for Android, this context is almost exclusively limited to
 geolocation.
 This project will therefore produce one of the first publicly available
 activity-aware applications for the Android platform.
\end_layout

\begin_layout Section
Location analysis
\begin_inset CommandInset label
LatexCommand label
name "sec:Location-analysis"

\end_inset


\end_layout

\begin_layout Standard
Location-based services are currently undergoing an 
\begin_inset Quotes eld
\end_inset

explosion
\begin_inset Quotes erd
\end_inset


\begin_inset CommandInset citation
LatexCommand cite
key "Bellavista2008"

\end_inset

, thanks to improvements in technology, and greater openness on the part
 of service providers and handset manufacturers.
 All modern smartphone platforms have a geolocation stack, usually backed
 by a GPS chipset and in most cases augmented with either a database of
 known cell tower locations, or a map of known WiFi network identifiers
 and locations, or both.
 The two databases allow for rough geolocation when GPS is not available,
 or for greatly decreased lookup time when a GPS lock is available.
\end_layout

\begin_layout Standard
However, while the geolocation stack is a rich source of data, it is a poor
 source of information.
 A latitude/longitude pair may describe the user's exact location, but a
 user would be hard-pressed to tell the difference between the latitude/longitud
e of their home, place of work, or of somewhere in between the two with
 no real significance.
 A great deal of research has therefore been devoted to detecting meaningful
 locations from GPS traces.
\end_layout

\begin_layout Standard
\begin_inset Quotes eld
\end_inset

Place recognition
\begin_inset Quotes erd
\end_inset

 has two phases: learning and recognising.
 An initial learning phase analyses a sensor log and segments the data into
 places where the device is stable (stationary), and designates this as
 a 
\begin_inset Quotes eld
\end_inset

waypoint
\begin_inset Quotes erd
\end_inset

.
 It then merges 
\begin_inset Quotes eld
\end_inset

waypoints
\begin_inset Quotes erd
\end_inset

 that appear to identify the same place being visited multiple times.
 The second phase uses these learned waypoints to recognise when the device
 is revisiting a place, and therefore also when the device is not visiting
 a previously known place (for example when it is moving between two)
\begin_inset CommandInset citation
LatexCommand cite
key "Hightower2005"

\end_inset

.
\end_layout

\begin_layout Standard
Unfortunately, quite a lot of research into location analysis uses GPS 
\begin_inset Quotes eld
\end_inset

blackspots
\begin_inset Quotes erd
\end_inset

 to identify useful places
\begin_inset CommandInset citation
LatexCommand cite
key "Nurmi2006,Liao2007b"

\end_inset

.
 With older GPS chipsets, the satellite signal would be lost when the user
 entered a building, and this allowed an inference that the current location
 was probably a place of interest.
 However, modern GPS chipsets receive a signal in most indoor locations.
 It is possible that a decrease in signal strength or number of locked satellite
s may still occur, or that GSM signal strength could be used instead, but
 these ideas have not been widely explored at present.
\end_layout

\begin_layout Standard
There is, however, plenty of research relating to the use of location data
 outdoors.
 One application
\begin_inset CommandInset citation
LatexCommand cite
key "Liao2007b"

\end_inset

 learns not only the user's frequently visited places, but the method of
 transport used between them and the typical routes taken.
 It can then offer instructions showing the user how to go from place to
 place, or issue alerts if the user appears to be going the wrong way (by
 getting on the wrong bus, for instance).
 The ability to correctly infer the user's destination would be extremely
 useful in a context-aware system: a user walking to do their grocery shopping
 is almost certainly going to want to interact with their phone differently
 than a user on a bus going to work.
\end_layout

\begin_layout Section
Bluetooth
\begin_inset CommandInset label
LatexCommand label
name "sec:Bluetooth"

\end_inset


\end_layout

\begin_layout Standard
The user's context depends on not only what they are doing, where they are
 doing it, but also who they are with.
 Sitting and eating lunch with a manager is quite a different context to
 sitting and eating lunch with a spouse.
 It would therefore be desirable to be able to identify between different
 people when performing context analysis.
\end_layout

\begin_layout Standard
One of the few ways that a mobile telephone can identify other people is
 by searching for 
\emph on
their
\emph default
 mobile telephones.
 This can be done by scanning for Bluetooth devices, which involves broadcasting
 a 
\begin_inset Quotes eld
\end_inset

device inquiry
\begin_inset Quotes erd
\end_inset

 message; if a device chooses to answer the inquiry, it discloses its unique
 MAC address and device class
\begin_inset Foot
status collapsed

\begin_layout Plain Layout
the device class tells us whether the device is a computer or a mobile telephone
, for example
\end_layout

\end_inset

.
 Unfortunately, this requires the person to not only be carrying a mobile
 telephone, but a Bluetooth-enabled model, and for them to have configured
 their device to have Bluetooth enabled and to be 
\begin_inset Quotes eld
\end_inset

visible
\begin_inset Quotes erd
\end_inset

.
 A study in 2004
\begin_inset CommandInset citation
LatexCommand cite
key "Eagle2004"

\end_inset

 found that only 1 in 150 people had such a configured device on a university
 campus.
 This figure will undoubtedly be greater now, and may well be greater when
 in public, but it highlights that only a handful of people may be detectable
 via their Bluetooth devices.
\end_layout

\begin_layout Standard
A study in 2006
\begin_inset CommandInset citation
LatexCommand cite
key "Nicolai2006"

\end_inset

 used a similar technique to monitor the social context of the user, introducing
 the idea of 
\begin_inset Quotes eld
\end_inset

familiar
\begin_inset Quotes erd
\end_inset

 people, 
\begin_inset Quotes eld
\end_inset

unfamiliar
\begin_inset Quotes erd
\end_inset

 people and 
\begin_inset Quotes eld
\end_inset

familiar strangers
\begin_inset Quotes erd
\end_inset

.
 These labels were applied based on the number of times their Bluetooth
 devices were detected 
\begin_inset Foot
status collapsed

\begin_layout Plain Layout
and by extension the number of times the user had come into contact with
 them
\end_layout

\end_inset

.
 While the definition of 
\begin_inset Quotes eld
\end_inset

familiar
\begin_inset Quotes erd
\end_inset

 and 
\begin_inset Quotes eld
\end_inset

unfamiliar
\begin_inset Quotes erd
\end_inset

 are quite obvious, 
\begin_inset Quotes eld
\end_inset

familiar strangers
\begin_inset Quotes erd
\end_inset

 is a new class of people used to describe those who the user encounters
 repeatedly, but doesn't interact with.
 This may include neighbours that are passed on the street, or fellow commuters
 on a journey into work.
 The number of people in each of those groups (and any changes in those
 numbers) can be used to infer how 
\begin_inset Quotes eld
\end_inset

comfortable
\begin_inset Quotes erd
\end_inset

 the user feels with their social context, and whether their current activity
 is part of a normal routine or is novel.
\end_layout

\begin_layout Standard
This research has, to date, not been readily combined with activity-aware
 applications, and this project will aim to integrate the results of Bluetooth
 scanning with 
\begin_inset Quotes eld
\end_inset

classical
\begin_inset Quotes erd
\end_inset

 activity classification techniques and to evaluate whether it provides
 any benefit.
\end_layout

\begin_layout Section
Power management
\begin_inset CommandInset label
LatexCommand label
name "sec:Power-management"

\end_inset


\end_layout

\begin_layout Standard
One major consideration when deploying an application on a mobile device
 is the amount of power it will use.
 An application constantly polling any one sensor can reduce battery life
 significantly, and an application which kept all available sensors active
 (in addition to doing CPU-heavy analysis on them) would drain the battery
 in a typical smartphone in a matter of hours.
 A context-aware application is not very useful for a user if they can only
 use their telephone for an hour or two before it needs recharging!
\end_layout

\begin_layout Standard
One solution
\begin_inset CommandInset citation
LatexCommand cite
key "Wang2009"

\end_inset

is to only use one or two sensors to monitor the user's activity until it
 appears to be transitioning.
 For example, if the user is believed to be walking, the application only
 needs to periodically check either the accelerometer (to confirm the user
 is still making walking motions) or GPS (to confirm the distance traveled
 is still consistent with walking) to know that their activity has not changed.
 As soon as the user's behaviour becomes inconsistent with walking, the
 application can bring other sensors online until it has successfully reclassifi
ed the activity, and then resume monitoring with minimal sensors.
\end_layout

\begin_layout Standard
Another option
\begin_inset CommandInset citation
LatexCommand cite
key "Wang2009"

\end_inset

 (which can be used in conjunction) is to only enable sensors for a short
 amount of time, and then sleep for a period before reactivating them.
 The 
\begin_inset Quotes eld
\end_inset

duty cycle
\begin_inset Quotes erd
\end_inset

 suggested for accelerometers is 6 second of sensing followed by 10 seconds
 of sleeping.
 The six second window is enough time to allow for capturing a full range
 of motion (several complete strides) if the user is walking or running,
 and then the ten second sleep stops the accelerometer using battery power
 until the next cycle.
 This process obviously means that a sudden switch in activity will not
 be noticed immediately, but a delay of a few seconds is acceptable as most
 activities will last for minutes or longer.
\end_layout

\begin_layout Standard
The battery life on modern smartphones rarely exceeds 24 hours of typical
 use, so it is extremely important that any applications developed for this
 project does not significantly reduce this.
 A balance between prompt detection and notification of activity changes
 and battery use by sensors and processing algorithms will need to be found.
\end_layout

\begin_layout Standard
\begin_inset Newpage pagebreak
\end_inset


\end_layout

\begin_layout Part
\begin_inset CommandInset label
LatexCommand label
name "par:Activity-classification"

\end_inset

Activity classification
\end_layout

\begin_layout Section
Sensor Logger application
\end_layout

\begin_layout Standard
The primary component of context that this project aims to expose is the
 user's activity.
 The main factor in determining a user's activity is the data retrieved
 from the device's accelerometers.
 This gave rise to the project's first published application, titled 
\noun on
Sensor Logger
\noun default
.
 The first version of 
\noun on
Sensor Logger
\noun default
 consisted of a single activity containing a large amount of text describing
 the project, an editable text field where the user could name their activity,
 and a button which initiated logging.
\end_layout

\begin_layout Standard
\begin_inset Float figure
wide false
sideways false
status collapsed

\begin_layout Plain Layout
\begin_inset Graphics
	filename components.png
	width 60page%

\end_inset


\end_layout

\begin_layout Plain Layout
\begin_inset Caption

\begin_layout Plain Layout
Sensor Logger component diagram
\begin_inset CommandInset label
LatexCommand label
name "fig:Sensor-Logger-component"

\end_inset


\end_layout

\end_inset


\end_layout

\end_inset

Once the user tapped the 'Start' button, the application launched a service
 which registered with the device's SensorManager and requested fast updates
 from both the accelerometer and the magnetic field sensor.
 Every 50ms the last value received from each axis on each sensor was written
 along with a timestamp to a file on the device.
 After 1024 samples were collected (a total of around 51 seconds), the service
 launched an uploader service and terminated itself.
 The uploader service read the file from the device's flash memory, opened
 a HTTP connection to the project website, and submitted the data to a PHP
 script.
 The PHP script in turn stored the data in a MySQL database.
 
\begin_inset CommandInset ref
LatexCommand prettyref
reference "fig:Sensor-Logger-component"

\end_inset

 shows the relationship between the various components involved in the Sensor
 Logger application.
\end_layout

\begin_layout Subsection
Market and user input
\begin_inset CommandInset label
LatexCommand label
name "sub:Market-and-user"

\end_inset


\end_layout

\begin_layout Standard
The Sensor Logger application was made available on the Android Market,
 under the name 'Sensor Logger Test'.
 The description briefly outlined the aim of the project and emphasised
 that the Sensor Logger was a data gathering tool and didn't really provide
 any utility to end users.
 Despite this, over 1,000 submissions were received from anonymous users.
 While some of these did not provide any use for the reasons discussed in
 
\begin_inset CommandInset ref
LatexCommand prettyref
reference "sec:Manual-classification"

\end_inset

, a number were manually classified and used to generate the model used
 in the final application.
\end_layout

\begin_layout Standard
\begin_inset Float figure
wide false
sideways false
status open

\begin_layout Plain Layout
\begin_inset Graphics
	filename analysis_of_user-submitted_sensor_logger_data_sets.png
	width 60page%

\end_inset


\end_layout

\begin_layout Plain Layout
\begin_inset Caption

\begin_layout Plain Layout
Analysis of user-submitted Sensor Logger results
\begin_inset CommandInset label
LatexCommand label
name "fig:Analysis-of-user-submitted"

\end_inset


\end_layout

\end_inset


\end_layout

\begin_layout Plain Layout

\end_layout

\end_inset

Version 0.2.0 of the Sensor Logger application introduced functionality where
 it classified the activity on the device before asking the user to name
 it (see 
\begin_inset CommandInset ref
LatexCommand prettyref
reference "sec:On-device-classification"

\end_inset

).
 This allowed the submitted data to be augmented with an extra field saying
 what the activity classification algorithm thought the activity was.
 If the user confirmed that the activity was correct, the manual activity
 annotation was set to 'UNCLASSIFIED/NOTCORRECTED'.
\end_layout

\begin_layout Standard
\begin_inset CommandInset ref
LatexCommand prettyref
reference "fig:Analysis-of-user-submitted"

\end_inset

 shows a breakdown of all the results that were received from version 0.2.0
 or later of the application.
 The raw data is included in 
\begin_inset CommandInset ref
LatexCommand prettyref
reference "sec:User-annotated-Sensor-Logger"

\end_inset

.
 Nearly half of all the submissions were classified correctly, and only
 15% were classified incorrectly.
 A large proportion of the submissions either had no text at all or had
 an activity that didn't make sense, such as 
\begin_inset Quotes eld
\end_inset

sjxjxgzog
\begin_inset Quotes erd
\end_inset

 or 
\begin_inset Quotes eld
\end_inset

it is a cat!
\begin_inset Quotes erd
\end_inset

.
 There were also 30 submissions where the user had annotated the data with
 an activity that makes sense, but which isn't supported by the Sensor Logger.
 The majority of these were 'Sleeping' - but it is unclear in these circumstance
s what the user is actually doing with their device; if it is left on a
 bedside table, for example, then there is no way to distinguish the actual
 activity of the user.
\end_layout

\begin_layout Standard
\begin_inset Float figure
wide false
sideways false
status open

\begin_layout Plain Layout
\begin_inset Graphics
	filename breakdown_of_incorrect_results.png
	width 60page%

\end_inset


\end_layout

\begin_layout Plain Layout
\begin_inset Caption

\begin_layout Plain Layout
Breakdown of incorrect results
\begin_inset CommandInset label
LatexCommand label
name "fig:Breakdown-of-incorrect"

\end_inset


\end_layout

\end_inset


\end_layout

\begin_layout Plain Layout

\end_layout

\end_inset


\begin_inset CommandInset ref
LatexCommand prettyref
reference "fig:Breakdown-of-incorrect"

\end_inset

 shows a breakdown of the results deemed incorrect.
 A large majority of these incorrect results occurred when the user was
 sitting down, and the Sensor Logger incorrectly classified them as being
 in a vehicle of some sort.
 Of the remaining incorrect entries, 15% correctly classified the correct
 top level in the hierarchy (such as 'VEHICLE' or 'WALKING') but then misclassif
ied further levels; the remaining 25% incorrectly classified this top level
 as well.
\end_layout

\begin_layout Subsection
Exception handling
\end_layout

\begin_layout Standard
Early user feedback on the Android Market indicated that the Sensor Logger
 application was 
\begin_inset Quotes eld
\end_inset

Force Closing
\begin_inset Quotes erd
\end_inset

.
 This is a reference to the dialog that appears when an application throws
 an unhandled exception and stops running.
 The Market provides no facilities to engage with users, and there were
 no force close issues present on either the Android emulator or several
 physical devices the application was tested on, so it was difficult to
 determine the cause.
\end_layout

\begin_layout Standard
In order to gain more data on this issue, an 
\noun on
UncaughtExceptionHandler
\noun default
 was written and appropriately registered with the application's thread.
 The exception handler is invoked by the 
\noun on
Thread
\noun default
 class any time a thread dies due to an unhandled exception.
 The implementation for the Sensor Logger application copied the details
 of any exception (including the reason and full stack trace) into a file,
 and then uploaded the file with some meta-data to the same website which
 was setup to handle uploading of accelerometer data.
\end_layout

\begin_layout Standard
Soon after an updated version of the Sensor Logger was published including
 the new exception handler a report was uploaded.
 The stack trace indicated that the problem was a 
\noun on
NumberFormatException
\noun default
 when trying to convert the device's IMEI number into a 
\noun on
long
\noun default
.
 After some brief research it became apparent that CDMA devices do not use
 IMEI numbers, but instead MEIDs (Mobile Equipment Identifier).
 MEIDs are hexadecimal instead of numerical, so obviously cannot be converted
 directly to a numeric type.
 The code was adjusted to decode MEIDs properly and a new version of the
 application published, and the error reports ceased.
\end_layout

\begin_layout Standard
From a development perspective, the utility of being notified directly of
 exceptions is immense.
 It is very difficult for users to find the details of an exception following
 a force close, so extremely unlikely that anyone will report problems in
 sufficient detail for them to be fixed.
 The exception handling code was therefore abstracted into a common class,
 and included in every application released as part of this project.
\end_layout

\begin_layout Section
Manual classification
\begin_inset CommandInset label
LatexCommand label
name "sec:Manual-classification"

\end_inset


\end_layout

\begin_layout Standard
\begin_inset Float figure
wide false
sideways false
status collapsed

\begin_layout Plain Layout
\begin_inset Graphics
	filename website-windows.png
	height 70pheight%
	rotateAngle 90

\end_inset


\end_layout

\begin_layout Plain Layout
\begin_inset Caption

\begin_layout Plain Layout
Website for manually classifying windows
\begin_inset CommandInset label
LatexCommand label
name "fig:Website-for-manually"

\end_inset


\end_layout

\end_inset


\end_layout

\begin_layout Plain Layout

\end_layout

\end_inset

Once the sensor data was logged in the database, a web interface provided
 a graphical representation of the acceleration and magnetic field readings.
 It also allowed a handful of authenticated users to manually classify overlappi
ng 
\begin_inset Quotes eld
\end_inset

windows
\begin_inset Quotes erd
\end_inset

 of 128 data points.
 The classification portion of the website is shown in 
\begin_inset CommandInset ref
LatexCommand prettyref
reference "fig:Website-for-manually"

\end_inset

; it shows the first six overlapping windows for one submission, with the
 third window highlighted because the user's cursor is over the corresponding
 dropdown.
 Users of this system could define activities in a hierarchical fashion,
 starting with two root nodes - 'CLASSIFIED' and 'UNCLASSIFIED'.
 Early data submitted resulted in a classification hierarchy of:
\end_layout

\begin_layout Itemize
UNCLASSIFIED
\end_layout

\begin_deeper
\begin_layout Itemize
PENDING (not yet manually assigned)
\end_layout

\begin_layout Itemize
UNKNOWN (unable to determine actual activity from user label)
\end_layout

\begin_layout Itemize
DNI (short for 
\begin_inset Quotes eld
\end_inset

Do Not Include
\begin_inset Quotes erd
\end_inset

, for windows which appear erroneous)
\end_layout

\end_deeper
\begin_layout Itemize
CLASSIFIED
\end_layout

\begin_deeper
\begin_layout Itemize
WALKING
\end_layout

\begin_deeper
\begin_layout Itemize
STAIRS (not used in itself)
\end_layout

\begin_deeper
\begin_layout Itemize
UP
\end_layout

\begin_layout Itemize
DOWN
\end_layout

\end_deeper
\end_deeper
\begin_layout Itemize
IDLE (not used in itself)
\end_layout

\begin_deeper
\begin_layout Itemize
SITTING
\end_layout

\begin_layout Itemize
STANDING
\end_layout

\end_deeper
\begin_layout Itemize
VEHICLE (not used in itself)
\end_layout

\begin_deeper
\begin_layout Itemize
CAR
\end_layout

\begin_layout Itemize
BUS
\end_layout

\end_deeper
\begin_layout Itemize
DANCING
\end_layout

\end_deeper
\begin_layout Standard
It was observed that many samples had erroneous data either at the start
 or the end of the recording.
 This was a result of the user putting the device away in a pocket (as instructe
d) or picking it back up to check the results.
 A classification of 'DNI', short for 'Do Not Include' was therefore introduced
 which allowed the erroneous windows to be summarily excluded from later
 analysis.
 Later iterations of the Sensor Logger application included a 10 second
 delay at the start to give the user time to put the device away, and sounded
 an audible alert at the end, which reduced the number of records submitted
 with bad data.
\end_layout

\begin_layout Standard
Another problem with the user submitted data was that some activity descriptions
 didn't make sense.
 With the earliest versions of the Sensor Logger, a significant number of
 users entered their own name or a nonsensical string into the textbox labeled
 
\begin_inset Quotes eld
\end_inset

Activity name
\begin_inset Quotes erd
\end_inset

.
 This suggested that users were either not reading or misunderstanding the
 instructions.
 A classification for 'UNKNOWN' was introduced to facilitate removal of
 the records where classifications couldn't be inferred from the activity
 name.
\end_layout

\begin_layout Section
Feature extraction
\end_layout

\begin_layout Standard
Once a reasonable sample of data had been recorded, the PHP script was modified
 to allow exporting of all classified windows.
 It produced a plain text file containing the sensor readings and timestamp
 for each of the 128 points in each window, as well as the manually-applied
 classification.
 It did not include information as to which windows were from the same sample,
 or the original user-supplied activity name.
 A small sample of this data is included in Appendix 
\begin_inset CommandInset ref
LatexCommand prettyref
reference "sec:Extract-from-export"

\end_inset

.
\end_layout

\begin_layout Standard
A Java program was written which imported the exported data.
 A series of 'feature extractors' were written.
 These calculated the:
\end_layout

\begin_layout Itemize
maximum
\end_layout

\begin_layout Itemize
minimum
\end_layout

\begin_layout Itemize
range
\end_layout

\begin_layout Itemize
median
\end_layout

\begin_layout Itemize
mean
\end_layout

\begin_layout Standard
Each of these extractors was run over the set of 128 data points from each
 axis on each sensor, giving a total of 30 features.
 It was planned to add further features including Fast Fourier Transforms
 and energy, as suggested by multiple papers consulted in background research.
\end_layout

\begin_layout Standard
The program was modified to export the features and classification of each
 window in ARFF
\begin_inset Note Note
status open

\begin_layout Plain Layout
ref
\end_layout

\end_inset

 (Attribute Relation File Format).
 This is a format used by Weka
\begin_inset Note Note
status open

\begin_layout Plain Layout
ref
\end_layout

\end_inset

, a popular data mining suite developed by the University of Waikato.
 A small sample of the ARFF data is included in Appendix 
\begin_inset CommandInset ref
LatexCommand prettyref
reference "sec:Extract-from-ARFF"

\end_inset

.
 The ARFF file was imported into Weka and analysed.
\end_layout

\begin_layout Standard
Inspection of a graphical representation of the correlation between mean
 and activity showed that in some samples the mean was negated but of a
 similar magnitude to other samples.
 This can be explained by the device being orientated in a different manner
 when the samples were taken - a static device would record a downwards
 acceleration of 9.8m/s if it is upright, but -9.8m/s if it is upside down.
 An extra feature extractor was therefore added which calculated the 
\emph on
absolute mean
\emph default
.
\end_layout

\begin_layout Standard
With these features, it was found that Weka could correctly classify activities
 with an accuracy of in excess of 95% (measured by holding back 
\begin_inset Formula $\frac{1}{3}$
\end_inset

 of the training data) using a K-Nearest Network algorithm with K = 1.
 It was therefore apparent that more complicated feature extraction techniques
 such as Fast Fourier Transforms or Energy would not be necessary to achieve
 a very high classification rate.
\end_layout

\begin_layout Standard
A lot of time was spent attempting to reduce the already small set of features
 further.
 Every feature that had to be calculated would result in more CPU usage
 when implemented on the device, which would in turn reduce battery life
 by a greater amount.
 This was done by a combination of experimentation based on educated guesses
 and assumption, and Weka's built in 
\begin_inset Quotes eld
\end_inset

select attributes
\begin_inset Quotes erd
\end_inset

 functionality.
\end_layout

\begin_layout Standard
In the end, a similar accuracy was achieved using only four features.
 These were the absolute mean and range of the X and Y axes of the accelerometer.
 No data at all was used from the magnetic field sensor or the Z axis of
 the accelerometer.
 This is an very useful result as the features are extremely cheap to calculate,
 and almost trivial to implement on the device.
 No libraries are needed to perform advanced mathematical functions, and
 individual samples do not need to be stored in memory until a complete
 window is obtained - the minimum, maximum and total of samples from the
 two axes simply have to be recorded.
 This is, perhaps, the first time activity inference has been performed
 successfully with such a small number of features.
\end_layout

\begin_layout Standard
The application was again modified to read the exported data, calculate
 the four interesting features, and create a mapping of data points to activity.
 This map was serialised into a file using an 
\noun on
ObjectWriter
\noun default
, which allows it to be read on both desktop platforms running a standard
 JVM, and the Android platform which contains compatible serialisation technolog
y.
\end_layout

\begin_layout Section
On-device classification
\begin_inset CommandInset label
LatexCommand label
name "sec:On-device-classification"

\end_inset


\end_layout

\begin_layout Standard
The serialised model was bundled with a new version of the Sensor Logger
 application, along with a completely redesigned user interface.
 The application now consisted of a series of activities: on opening the
 application, the user is presented with an introduction activity which
 explains what the application does and the aims of the project; when they
 click the 'next' button a 10 second countdown is displayed with the instruction
 to put the phone away repeated.
 During the data collection period an animated pattern of dots is displayed
 so the user knows the application is still working if they look at it.
 When data collection is completed, the device adds a notification with
 sound and vibrate settings, and displays another progress screen while
 a background service analyses the data.
 The result of the classification is then displayed prominently and the
 user is presented with two buttons - one to confirm the classification
 and one to reject and correct it.
 The on-device classification (and any correction made to it) is submitted
 along with all the data previously submitted.
 Finally, the user is then presented with a 'Thank you' message, and a unique
 link to the project website where they can view graphs of their activities.
\begin_inset Note Note
status open

\begin_layout Plain Layout
Mess!
\end_layout

\end_inset


\end_layout

\begin_layout Section
Activity Recorder application
\end_layout

\begin_layout Standard
\begin_inset Note Note
status open

\begin_layout Plain Layout
Screenshot
\end_layout

\end_inset


\end_layout

\begin_layout Standard
The Activity Recorder application was the second application published on
 the market.
 In contrast to the sensor logger, it only records the two relevant axes
 of the accelerometer, and all data is kept in memory instead of being written
 to a file.
\end_layout

\begin_layout Standard
The activity recorder consists of a background service which records 128
 samples of sensor data once every 30 seconds.
 At all other times, the accelerometer is not accessed to conserve battery
 power.
 The samples are then classified using the same model as the Sensor Logger
 application, and the resulting activity is appended to a list.
 Consecutive samples which are classified as the same activity are merged
 together.
\end_layout

\begin_layout Standard
The user interface displays a list of activities, along with their start
 time and duration in minutes or hours.
\end_layout

\begin_layout Subsection
Acquiring data while screen is off
\begin_inset CommandInset label
LatexCommand label
name "sub:Acquiring-data-while"

\end_inset


\end_layout

\begin_layout Standard
The activity recorder brought to light a problem that was discovered to
 be present in the sensor logger as we, but hadn't been noticed at the time.
 When the device's screen was turned off, both applications stopped receiving
 sensor events.
 Some research and experimentation revealed that in order to continue receiving
 sensor data when the device went to 
\begin_inset Quotes eld
\end_inset

sleep
\begin_inset Quotes erd
\end_inset

, the application had to acquire a partial wake lock from the system's power
 manager.
 A full wake lock keeps the device fully awake with the screen on, whereas
 a partial wake lock allows background processing to continue while the
 screen is deactivated.
\end_layout

\begin_layout Standard
Once the applications were modified to acquire a partial wake lock, they
 both received sensor data as expected with the screen off.
 However, testing on Android 2.0 (
\begin_inset Quotes eld
\end_inset

Eclair
\begin_inset Quotes erd
\end_inset

) devices still showed the original problem.
 The cause of this was a change in the functionality of the sensor manager
 introduced between 1.6 and 2.0 which prevents sensor data being received
 when the device is sleeping, regardless of any wake locks held.
 An issue raised on their official issue tracker revealed that the Android
 developers considered this a bug, and that it would be rectified in a future
 version.
 When Android 2.2 (
\begin_inset Quotes eld
\end_inset

Froyo
\begin_inset Quotes erd
\end_inset

) was released, testing revealed that the issue was indeed fixed, and all
 applications worked as expected.
 There therefore exists an incompatibility with handsets running Android
 2.0 and 2.1.
\end_layout

\begin_layout Subsection
Aggregating classifications to smooth results
\begin_inset CommandInset label
LatexCommand label
name "sub:Aggregating-classifications-to"

\end_inset


\end_layout

\begin_layout Standard
Another problem raised by the Activity Recorder application is that of occasiona
l incorrect results.
 Because each data was only sampled for five seconds once a minute, it is
 possible that during those five seconds the activity being performed does
 not lend itself to proper classification of the user's actual, medium-term
 activity.
 For example, if a user is walking for 20 minutes and happens to stop several
 times to cross roads, samples while the user is stopped will (correctly)
 indicate that they are standing still, but for all practical purposes they
 are still engaged in the act of walking.
 Similarly, when traveling in a car it is possible for occasional samples
 to be misclassified as traveling by bus, or vice-versa.
\end_layout

\begin_layout Standard
To combat this problem, an activity 
\begin_inset Quotes eld
\end_inset

aggregator
\begin_inset Quotes erd
\end_inset

 was introduced.
 This accepts classifications and uses them to adjust a set of internal
 probabilities for each possible (sub-)classification.
 The algorithm increases the likelihood score of each component in a classificat
ion by a constant amount, and reduces all other components by a fixed ratio.
 This smooths out results, and allows for classifications not directly supported
 by the model when the data is unclear and alternating.
 This behaviour is most useful when traveling by vehicle and classifications
 alter between 
\begin_inset Quotes eld
\end_inset

car
\begin_inset Quotes erd
\end_inset

 and 
\begin_inset Quotes eld
\end_inset

bus
\begin_inset Quotes erd
\end_inset

 - both contributed positively to the likelihood of 
\begin_inset Quotes eld
\end_inset

CLASSIFIED/VEHICLE
\begin_inset Quotes erd
\end_inset

, and this ends up being the result presented by the aggregator.
\end_layout

\begin_layout Standard
\begin_inset Newpage pagebreak
\end_inset


\end_layout

\begin_layout Part
\begin_inset CommandInset label
LatexCommand label
name "par:Other-sensors"

\end_inset

Other sensors
\end_layout

\begin_layout Section
Bluetooth
\begin_inset CommandInset label
LatexCommand label
name "sec:Bluetooth-1"

\end_inset


\end_layout

\begin_layout Standard
Being able to identify who the user is accompanied by would be extremely
 beneficial in a context-aware system.
 One of the few ways to do this at present is to monitor the presence of
 other user's mobile telephones by scanning for visible Bluetooth devices.
 As discussed in 
\begin_inset CommandInset ref
LatexCommand prettyref
reference "sec:Bluetooth"

\end_inset

, if sufficient devices are visible, users can be classified according to
 whether they are familiar, strangers, or familiar strangers.
 This provides a great deal of context to the user's activity.
\end_layout

\begin_layout Standard
Before this Bluetooth algorithm can be implemented, it needs to be determined
 whether there are a sufficient number of discoverable devices to make it
 worthwhile.
 As with any radio transceiver, a lot of battery power is consumed when
 Bluetooth is enabled and the device is actively scanning for others.
 This means that if there are insufficient discoverable devices, the cost
 of enabling and scanning for Bluetooth devices would outweigh the benefits.
 As mentioned previously, there is no use in a very accurate context API
 if the user's battery only lasts for a few hours.
\end_layout

\begin_layout Standard
To determine the utility of scanning for Bluetooth devices, a group of three
 volunteers were asked to manually enable Bluetooth and scan for devices
 using the built in functionality exposed in Android's settings screens.
 It was planned to create an application which could scan and classify devices
 appropriately but the Bluetooth API is only exposed to user-space applications
 in version 5 of the Android SDK, which corresponds to the 
\begin_inset Quotes eld
\end_inset

Eclair
\begin_inset Quotes erd
\end_inset

 or 2.0 release; at the time of the experiment, only one of the three volunteers
 was using a device for which Eclair was available.
 This also means that adding Bluetooth support would have a further cost
 of having to either limit access to pre-2.0 users, maintain two separate
 versions of the application, or spend extra time developing a solution
 which would attempt to use the Bluetooth API if and only if it is available.
\end_layout

\begin_layout Standard
\begin_inset Float table
placement h
wide false
sideways false
status open

\begin_layout Plain Layout
\begin_inset Tabular
<lyxtabular version="3" rows="13" columns="7">
<features>
<column alignment="center" valignment="top" width="0">
<column alignment="center" valignment="top" width="0">
<column alignment="center" valignment="top" width="0">
<column alignment="center" valignment="top" width="0">
<column alignment="center" valignment="top" width="0">
<column alignment="center" valignment="top" width="0">
<column alignment="center" valignment="top" width="0">
<row>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
Environment
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
Devices
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
People
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
Discoverable
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
Familiar
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
Familiar Strangers
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
Strangers
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
Car
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
0
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
1
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
0%
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
1
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
0
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
0
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
Bus
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
1
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
20
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
5%
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
0
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
0
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
20
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
Street
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
2
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
15
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
13%
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
0
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
0
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
15
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
Bar
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
2
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
12
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
17%
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
1
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
1
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
10
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
Office
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
0
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
6
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
0%
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
5
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
1
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
0
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
Office
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
0
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
4
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
0%
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
4
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
0
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
0
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
Home
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
0
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
1
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
0%
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
1
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
0
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
0
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
Home
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
0
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
2
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
0%
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
2
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
0
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
0
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
Lecture
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
5
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
80
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
6%
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
10
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
70
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
0
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
Meeting
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
1
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
6
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
17%
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
6
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
0
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
0
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
Restaurant
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
2
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
22
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
9%
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
1
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
2
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
19
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
Supermarket
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
2
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
1
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
200%
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
0
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
0
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
1
\end_layout

\end_inset
</cell>
</row>
</lyxtabular>

\end_inset


\end_layout

\begin_layout Plain Layout
\begin_inset Caption

\begin_layout Plain Layout
Bluetooth scanning results
\begin_inset CommandInset label
LatexCommand label
name "tab:Bluetooth-scanning-results"

\end_inset


\end_layout

\end_inset


\end_layout

\begin_layout Plain Layout

\end_layout

\end_inset

For the experiment, the users were asked to record the number of visible
 Bluetooth devices, their environment and the estimated number of people
 around them.
 They were also asked to classify the people into rough groups of 
\begin_inset Quotes eld
\end_inset

familiar
\begin_inset Quotes erd
\end_inset

 (such as co-workers, family and friends), 
\begin_inset Quotes eld
\end_inset

familiar strangers
\begin_inset Quotes erd
\end_inset

 (people they see regularly but are not particularly familiar with), or
 
\begin_inset Quotes eld
\end_inset

strangers
\begin_inset Quotes erd
\end_inset

.
 The results are itemised in 
\begin_inset CommandInset ref
LatexCommand prettyref
reference "tab:Bluetooth-scanning-results"

\end_inset

.
\end_layout

\begin_layout Standard
The results show that in general there is a very poor proportion of devices
 that are visible.
 The results also suggest that Bluetooth would be a poor method for finding
 
\begin_inset Quotes eld
\end_inset

familiar
\begin_inset Quotes erd
\end_inset

 people, as the situations with very few strangers generally had almost
 no discoverable devices.
 There are several possible reasons for the low proportion of devices: modern
 phones tend to default to having Bluetooth switched off for reasons of
 battery life and user privacy, and even when enabled the devices tend to
 default to being non-discoverable.
 In fact, Android devices will only allow the user to make the device discoverab
le for 30 seconds at a time - the setting is automatically reverted after
 this period.
 Another consideration is that the three volunteers are all involved in
 extremely technology-focused settings: one was a student studying a computing
 course, one a software engineer, and one a systems administrator.
 Whether or not these technology-rich settings would artificially inflate
 results (more technology means more discoverable devices) or deflate them
 (more tech-savvy users mean fewer needlessly enabling Bluetooth discovery)
 is unclear.
\end_layout

\begin_layout Section
Microphone
\begin_inset CommandInset label
LatexCommand label
name "sec:Microphone"

\end_inset


\end_layout

\begin_layout Standard
Reading raw data from the Microphone on Android is relatively straight forward
 thanks to the built-in 
\noun on
AudioRecord
\noun default
 class.
 This allows raw data to be retrieved directly into an array of bytes, where
 it can then be analysed.
 A class was written which constructs an 
\noun on
AudioRecord
\noun default
 instance, retrieves a sample of data, and calculates the sound pressure
 level (SPL).
 The SPL can be used to measure the ambient volume of the environment the
 device is in - for example, a quiet room would typically have an SPL of
 20-30 dB, a television might raise that to the level of 60 dB, and a busy
 road could be up to 90 dB.
 SPL is calculated using the formula 
\begin_inset Formula $L_{p}=20log_{10}(\frac{p_{rms}}{p_{ref}})$
\end_inset

.
 
\begin_inset Formula $p_{ref}$
\end_inset

 is the reference sound level and is usually taken to be 20 micropascals,
 which is the limit of human hearing; 
\begin_inset Formula $p_{rms}$
\end_inset

 is the root mean square pressure being measured.
\end_layout

\begin_layout Standard
While the class was able to correctly calculate the SPL, it is not used
 in any of the published applications.
 The original intention was to use SPL to assist in activity inference,
 but as shown in 
\begin_inset CommandInset ref
LatexCommand prettyref
reference "sub:Market-and-user"

\end_inset

 the accelerometer alone achieves a satisfactory classification rate on
 its own.
 The large majority of incorrect classifications revolved around the user
 sitting down and, as sitting is such a universal activity (i.e., it's performed
 everywhere), knowing the ambient SPL will not help in this classification.
\end_layout

\begin_layout Standard
While there are certainly use cases for knowing the SPL (the most obvious
 being increasing or decreasing the ringer volume in proportion to the SPL
 to ensure it can be heard), most of them do not involve any other form
 of context that this project is aiming to expose.
 It was therefore decided to not include the SPL data in the main context
 API.
\end_layout

\begin_layout Section
Camera
\begin_inset CommandInset label
LatexCommand label
name "sec:Camera"

\end_inset


\end_layout

\begin_layout Standard
The aim of incorporating data from the device's camera was to determine
 the ambient lighting conditions.
 It could possibly then be inferred whether the user was in natural or artificia
l light, or in darkness.
 However on consultation with a group of five prospective users it became
 clear that at the times at which the device would be classifying context,
 it would almost always be inside a pocket or a bag.
 The only times the device would be able to detect lighting conditions would
 be as the user was using it (which is too late as the device should have
 already adapted to the user's context) or when the device had been left
 on a desk or shelf.
 It was therefore decided to not include camera data at this stage of the
 project.
\end_layout

\begin_layout Standard
\begin_inset Newpage pagebreak
\end_inset


\end_layout

\begin_layout Part
\begin_inset CommandInset label
LatexCommand label
name "par:Places"

\end_inset

Places
\end_layout

\begin_layout Section
Use of GPS/GSM blackspots
\begin_inset CommandInset label
LatexCommand label
name "sec:Use-of-GPS/GSM"

\end_inset


\end_layout

\begin_layout Standard
As discussed in 
\begin_inset CommandInset ref
LatexCommand prettyref
reference "sec:Location-analysis"

\end_inset

 a lot of existing research into identifying interesting places relied on
 the fact that with hardware that is now 5-10 years old, you could not reliably
 get a GPS signal indoors.
 Thus whenever the user remained somewhere without a GPS signal it was likely
 that they were spending time indoors, and therefore their current location
 would be noteworthy.
\end_layout

\begin_layout Standard
Unfortunately, modern GPS hardware is much more sensitive and can quite
 easily get a signal indoors in most circumstances.
 One possible solution to this was to monitor the strength of either the
 GPS lock or the GSM signal, and attempt to determine whether or not a differenc
e was noticeable.
 An experiment was therefore conducted to record the GPS and GSM status
 for multiple indoor and outdoor locations.
\end_layout

\begin_layout Standard
\begin_inset Float table
placement bh
wide false
sideways false
status collapsed

\begin_layout Plain Layout
\begin_inset Tabular
<lyxtabular version="3" rows="9" columns="4">
<features>
<column alignment="center" valignment="top" width="0">
<column alignment="center" valignment="top" width="0">
<column alignment="center" valignment="top" width="0">
<column alignment="center" valignment="top" width="0">
<row>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
Location
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
GSM strength
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
GPS satellites
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
GPS time to fix
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
Indoors
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
-101 dBm
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
10
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
<1 sec
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
Outdoors
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
-101 dBm
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
8
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
<1 sec
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
Indoors
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
-71 dBm
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
6
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
2 sec
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
Outdoors
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
-67 dBm
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
7
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
2 sec
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
Indoors
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
-67 dBm
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
11
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
<1 sec
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
Outdoors
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
-67 dBm
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
10
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
3 secs
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
Indoors
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
-67 dBm
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
10
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
<1 sec
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
Outdoors
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
-43 dBm
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
10
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
<1 sec
\end_layout

\end_inset
</cell>
</row>
</lyxtabular>

\end_inset


\end_layout

\begin_layout Plain Layout
\begin_inset Caption

\begin_layout Plain Layout
GPS and GSM strengths
\begin_inset CommandInset label
LatexCommand label
name "tab:GPS-and-GSM"

\end_inset


\end_layout

\end_inset


\end_layout

\begin_layout Plain Layout

\end_layout

\end_inset

At four separate indoor locations, the third-party 
\noun on
GPS Status
\noun default
 application was used to observe the number of satellites the device was
 receiving a signal from, and the amount of time it took to acquire a fix
 on all of those satellites.
 The GSM signal strength as reported by the device's built in debugging
 tools was also recorded.
 The device was then moved outdoors to the nearest appropriate open area
 (footpath, outdoor seating area, etc), and the process was repeated.
 The results are summarised in 
\begin_inset CommandInset ref
LatexCommand prettyref
reference "tab:GPS-and-GSM"

\end_inset

.
\end_layout

\begin_layout Standard
While the indoor GSM strength is lower than the corresponding outdoor strength
 in two out of the four samples, it is still significantly stronger than
 the weakest recorded indoor or outdoor signal.
 In the other two cases the signal strength was the same for both indoors
 and outdoors.
 The GSM signal strength therefore seems to be a poor indicator of whether
 or not the user is indoors - it would have to be continually monitored
 to detect a drop in signal strength, and the (limited) experimental data
 shows that this would have a 50% false negative rate.
 The experiment does not allow us to reason about false positives, but it
 is easy to imagine that many circumstances would give rise to drops in
 signal strength - the most obvious being moving away from the cell tower.
\end_layout

\begin_layout Standard
The GPS results show even less correlation between indoor and outdoor readings.
 In two out of the four locations, the indoor test identified more satellites
 than the outdoor test - the opposite to what would be expected.
 This could be because the indoor locations were typically above ground
 level - the extra altitude may be more beneficial to obtaining a lock than
 the obstruction of the building itself.
 It seems more likely, however, that the numbers are not correlated in any
 way, and a larger experiment would reveal it to be random variance.
 Similarly, the time taken to lock the satellites is typically very small,
 but in a few situations there is a noticeable delay.
 The location which resulted in a three second lock time was repeated after
 a thirty second pause and obtained a sub-second lock time, but the original
 data was included in the results.
\end_layout

\begin_layout Standard
The experiment, although extremely limited in size, shows that it is unlikely
 that GSM strength or GPS metadata would be useful in determining interesting
 places.
 Alternative methods therefore had to be considered.
\end_layout

\begin_layout Section
Detecting places by time spent
\end_layout

\begin_layout Standard
Without information about whether or not the user is indoors, the next best
 method to detect interesting places is by monitoring the amount of time
 the user spends there.
 It stands to reason that a location where the user is only present fleetingly
 as they pass through is less important than somewhere they spend half a
 day.
\end_layout

\begin_layout Standard
The Android operating system provides two methods of determining the user's
 location - 
\begin_inset Quotes eld
\end_inset

coarse
\begin_inset Quotes erd
\end_inset

, which uses a cell tower and WiFi access point database, and 
\begin_inset Quotes eld
\end_inset

fine
\begin_inset Quotes erd
\end_inset

 which uses the device's GPS chipset.
 While 
\begin_inset Quotes eld
\end_inset

coarse
\begin_inset Quotes erd
\end_inset

 is less accurate than using GPS, it also uses significantly less battery
 power.
 Brief testing revealed that while GPS regularly obtained accuracies of
 below five metres, 
\begin_inset Quotes eld
\end_inset

network
\begin_inset Quotes erd
\end_inset

 location (using cell tower IDs and a built-in database) obtained accuracies
 in the region of 500 metres.
 Network location augmented with the built-in database of WiFi access point
 locations obtained accuracies in the same region as GPS.
 However, WiFi augmentation only works when the user has elected to enable
 WiFi on their device, and this puts a large drain on the battery.
\end_layout

\begin_layout Standard
As the most important places a user typically visits will be much greater
 than 500 metres apart, 
\begin_inset Quotes eld
\end_inset

coarse
\begin_inset Quotes erd
\end_inset

 location will was used for all location-related tasks in the project.
 Because of this large inaccuracy, places could not be represented by a
 single point but must have a radius to compensate for the inaccuracy.
 Based on earlier experimentation, this radius was fixed at 500 metres.
\end_layout

\begin_layout Standard
A new 
\begin_inset Quotes eld
\end_inset

place
\begin_inset Quotes erd
\end_inset

 is identified when the user remains within 500 metres of a point for at
 least 3 minutes.
 This figure is, hopefully, long enough to eliminate places where the user
 is temporarily held up (such as traffic lights), but short enough to include
 places the user visits but doesn't remain for a long length of time (such
 as supermarkets).
 When implementing this algorithm, care was taken to ensure that the length
 of time was defined as a constant and so could easily be changed if experimenta
l data showed that it was either too long or too short.
\end_layout

\begin_layout Standard
\begin_inset Newpage pagebreak
\end_inset


\end_layout

\begin_layout Part
\begin_inset CommandInset label
LatexCommand label
name "par:The-Context-Analyser"

\end_inset

The 
\noun on
Context Analyser
\noun default
 and applications
\end_layout

\begin_layout Standard
The primary output of this project is the 
\noun on
Context Analyser
\noun default
 application, and several further applications which use the services exposed
 by the 
\noun on
Context Analyser.

\noun default
 
\end_layout

\begin_layout Section
The 
\noun on
Context Analyser
\end_layout

\begin_layout Standard
The 
\noun on
Context Analyser
\noun default
 itself is an application with a single service, a single activity, and
 four content providers.
 Its purpose is to monitor the user's context, analyse it as necessary,
 and expose the data to other applications which will actually do something
 useful with it.
 It reuses components developed for the 
\noun on
Activity Recorder
\noun default
 application to retrieve and process accelerometer input, and a 
\noun on
LocationMonitor
\noun default
 class which wraps around Android's built in location services.
 Persistent data such as places is stored in a 
\noun on
SQLite
\noun default
 database, with logic in a custom helper class which handles creation and
 maintenance of tables and allows interaction with the database without
 exposing SQL to the rest of the application.
\end_layout

\begin_layout Subsection
Accelerometer and location components
\end_layout

\begin_layout Standard
\begin_inset Float figure
wide false
sideways false
status collapsed

\begin_layout Plain Layout
\begin_inset Graphics
	filename uml-accel.png
	scale 50
	rotateAngle 90

\end_inset


\end_layout

\begin_layout Plain Layout
\begin_inset Caption

\begin_layout Plain Layout
Accelerometer component class diagram
\begin_inset CommandInset label
LatexCommand label
name "fig:Accelerometer-component-class"

\end_inset


\end_layout

\end_inset


\end_layout

\begin_layout Plain Layout

\end_layout

\end_inset


\begin_inset CommandInset ref
LatexCommand prettyref
reference "fig:Accelerometer-component-class"

\end_inset

 shows the key components used in the activity inference portion of the
 
\noun on
Context Analyser.

\noun default
 The 
\noun on
accel
\noun default
 package handles low-level collection of accelerometer readings.
 The 
\noun on
RealAccelReader
\noun default
 class registers itself to receive sensor events and then makes the received
 data available through a public method.
 It also handles acquiring of a wake lock as discussed in 
\begin_inset CommandInset ref
LatexCommand prettyref
reference "sub:Acquiring-data-while"

\end_inset

 to keep the device sufficiently 'awake' to collect sensor data.
 
\noun on
AccelReader
\noun default
s are constructed by a factory so that they can be swapped out for test
 implementations if required, or when using an emulator which lacks real
 acceleration sensors.
\end_layout

\begin_layout Standard
The 
\noun on
Sampler
\noun default
 class handles automatic, timed sampling of a reader.
 Once started, it starts its 
\noun on
AccelReader
\noun default
 and then records a sample every 50ms until it has obtained 128 samples.
 As it retrieves each sample, it computes the minimum, maximum and sum of
 both axes that are needed for classification.
 When 128 samples have been recorded, it executes the 
\noun on
run
\noun default
 method of a 
\noun on
Runnable
\noun default
 provided at construction, so the owner can retrieve the results and analyse
 them appropriately.
\end_layout

\begin_layout Standard
The 
\noun on
Classifier
\noun default
 is identical to that used in both the 
\noun on
Sensor Logger
\noun default
 and 
\noun on
Activity Recorder
\noun default
 applications, and applies the K-Nearest Network algorithm to its given
 input and model.
 The 
\noun on
ModelReader
\noun default
 is a utility class which reads and deserialises the model bundled with
 the application.
\end_layout

\begin_layout Standard
The 
\noun on
Aggregator
\noun default
 handles aggregation of a stream of classifications, smoothing out occasional
 spurious results as discussed in 
\begin_inset CommandInset ref
LatexCommand prettyref
reference "sub:Aggregating-classifications-to"

\end_inset

.
 The 
\noun on
AutoAggregator
\noun default
 is an extension of this which automatically uses a 
\noun on
Sampler
\noun default
 and a 
\noun on
Classifier
\noun default
 to obtain the classifications itself.
 As with 
\noun on
AccelReader
\noun default
s, it is constructed by a factory so it can be swapped out for a stubbed
 implementation with ease.
 The factory will provide a 
\noun on
FakeAutoAggregator
\noun default
 if it detects it is running on the Android Emulator; this implementation
 simply cycles through a list of pre-defined activities to allow mocking
 of the entire activity inference procedure.
\end_layout

\begin_layout Standard
Together, these components are capable of inferring and aggregating the
 user's current activity from accelerometer data.
 The factory classes facilitate injection of deterministic classes which
 can be used to test the system or to eliminate the system from any testing
 entirely.
\end_layout

\begin_layout Standard
The location handling package consists of one interface, a factory, and
 two concrete implementations.
 The 
\noun on
LocationMonitor
\noun default
 interface simply specifies methods to retrieve the current latitude, longitude
 and accuracy.
 A concrete 
\noun on
RealLocationMonitor
\noun default
 implements this by registering for location events with Android's built
 in 
\noun on
LocationManager
\noun default
 service, while the 
\noun on
FakeLocationMonitor
\noun default
 merely cycles through a pre-defined list of latitude and longitude pairs.
 A factory class determines which implementation to return based on whether
 or not the code is being executed on an emulator.
\end_layout

\begin_layout Subsection
The 
\noun on
ContextAnalyserService
\end_layout

\begin_layout Standard
The 
\noun on
ContextAnalyserService
\noun default
 is an Android 
\noun on
Service
\noun default
 that handles periodic querying of the accelerometer and location components
 described above, and other assorted tasks related to that data.
 When it starts, the service creates a new 
\noun on
AutoAggregator
\noun default
, a new 
\noun on
DataHelper
\noun default
, an instance of Android's built in 
\noun on
Geocoder
\noun default
 class, and a 
\noun on
LocationMonitor
\noun default
.
 It also retrieves a list of place names which have not yet been geocoded,
 registers a listener for an application preferences setting titled 
\begin_inset Quotes eld
\end_inset

run
\begin_inset Quotes erd
\end_inset

, and schedules its polling method to be called after a sixty second delay.
\end_layout

\begin_layout Standard
Every sixty seconds, the service then:
\end_layout

\begin_layout Itemize
Retrieves the current latitude and longitude from its 
\noun on
LocationMonitor
\end_layout

\begin_layout Itemize
Computes the distance between the last stored location and the new position
\end_layout

\begin_deeper
\begin_layout Itemize
If the distance is less than 500m, there is no known Place associated with
 the current location, and this location has been observed at least three
 times:
\end_layout

\begin_deeper
\begin_layout Itemize
Creates a new place with the latitude and longitude as a name
\end_layout

\begin_layout Itemize
Tells the data helper to add the place to the database
\end_layout

\begin_layout Itemize
Adds the place to the list of place names needing geocoding
\end_layout

\end_deeper
\begin_layout Itemize
If the distance is greater than 500m:
\end_layout

\begin_deeper
\begin_layout Itemize
Update the stored latitude and longitude to the new values
\end_layout

\begin_layout Itemize
If the previous location had an associated Place, tell the data helper to
 record the visit
\end_layout

\end_deeper
\begin_layout Itemize
In both cases:
\end_layout

\begin_deeper
\begin_layout Itemize
Ask the data helper to find a Place corresponding to the new location, if
 a place is found:
\end_layout

\begin_layout Itemize
Record the current time as the start time for this visit
\end_layout

\begin_layout Itemize
If a place had been visited previously, tell the data helper to record a
 new journey with the activity log
\end_layout

\begin_layout Itemize
If the place is different to the last know place, send a broadcast intent
\end_layout

\end_deeper
\end_deeper
\begin_layout Itemize
Attempts to geocode any places with latitude/longitude names
\end_layout

\begin_layout Itemize
Starts the auto aggregator
\end_layout

\begin_layout Standard
When the auto aggregator finishes, the service retrieves the new aggregated
 classification.
 If the user is not at a known place, but has been to one in the past, the
 activity is added to the activity log and the service checks for predictions.
 If the activity is different to the last known activity, a broadcast intent
 is sent.
\end_layout

\begin_layout Standard
Predictions work by checking for journeys which begin with similar activities
 to those recorded in the activity log.
 The data helper retrieves all known journeys originating at the user's
 last known location.
 Each journey is then analysed to determine if it is compatible with the
 current activity log.
 This involves comparing the activities in the journey to make sure that
 they're the same as those logged, and the amount of time spent doing that
 activity is reasonably close.
 The current implementation allows for a ±50% variance in the number of
 repetitions of an activity.
 The activity log is also allowed to be a subset of the journey being tested,
 as long as the subset includes the beginning of the journey (that is, the
 activity log is allowed to be incomplete).
 If the activity log is found to be compatible with the journey, the journey
 is added to a list.
\end_layout

\begin_layout Standard
Once a list of compatible journeys has been found, they are grouped by destinati
on and the number of times each journey was made is summed into a 
\begin_inset Quotes eld
\end_inset

score
\begin_inset Quotes erd
\end_inset

 for each destination.
 The best destination is then included in a broadcast intent, and all of
 the predicted destinations are cached for use by the predictions content
 provider.
\end_layout

\begin_layout Standard
The 
\noun on
ContextAnalyserService
\noun default
 exposes a 
\noun on
Bindable
\noun default
 interface with methods for retrieving the current activity and any predictions.
 This is used for intra-process communication: content providers for the
 activity and predictions can 
\emph on
bind
\emph default
 to the service and request the data they need directly.
 Other content providers simply access the shared SQLite database themselves,
 so do not need to communicate directly with the service.
\end_layout

\begin_layout Subsection
The public API
\end_layout

\begin_layout Standard
The primary purpose of the 
\noun on
ContextAnalyser
\noun default
 application is to expose the contextual information to third-party developers
 in an easy-to-user manner.
 To cater to different types of applications, two distinct methods are provided
 that expose data: a set of 
\emph on
broadcast intents
\emph default
 which notify interested parties as and when a change occurs, and a collection
 of 
\emph on
content providers
\emph default
 that allow contextual data to be queried as it is needed.
\end_layout

\begin_layout Subsubsection*
Broadcast Intents
\end_layout

\begin_layout Standard
As mentioned above, the 
\noun on
ContextAnalyserService
\noun default
 fires broadcast intents on certain occasions, namely:
\end_layout

\begin_layout Itemize
whenever the (aggregated) activity changes
\end_layout

\begin_layout Itemize
whenever the place associated with the user's location changes
\end_layout

\begin_layout Itemize
whenever predictions are calculated
\end_layout

\begin_layout Standard
Third-party applications create 
\noun on
BroadcastReceivers
\noun default
 which can receive these intents.
 
\noun on
BroadcastReceivers
\noun default
 can be registered in code or in the application's manifest file; in the
 latter case, their creation and maintenance is handled by the OS itself,
 so there is very little overhead in terms of memory or CPU usage for the
 application.
 Each of the broadcast intents include relevant data such as the new activity,
 new place ID, or most likely predicted destination.
 This allows applications to implement a lightweight receiver which is able
 to check conditions and launch a service or activity in response to the
 user's context.
\end_layout

\begin_layout Subsubsection*
Content providers
\end_layout

\begin_layout Standard
For applications which need more detailed information, or wish to poll the
 current state instead of receiving it asynchronously, the 
\noun on
ContextAnalyser
\noun default
 defines a set of Android content providers.
 An activity or service can query a content provider by simply providing
 its URI, and optionally a projection, selection, and custom ordering.
 In return, it receives a Cursor object which can be used to iterate over
 and retrieve all the results of the query.
 Content providers are used extensively by the Android OS, for example for
 accessing contacts, e-mail and SMS messages.
\end_layout

\begin_layout Standard
Two content providers - journeys and places - simply pass queries directly
 on to the backend database, which retrieves data from (or modifies data
 in) the journey, journeysteps and locations tables.
 This is extremely simple to implement as the Android 
\noun on
SQLiteDatabase
\noun default
 class has a query method with the same signature as that implemented by
 content providers.
\end_layout

\begin_layout Standard
A further two content providers - activities and predictions - are backed
 by data retrieved from the 
\noun on
ContextAnalyserService
\noun default
 via its bindable interface, as discussed previously.
 The retrieved data is added to a 
\noun on
MatrixCursor
\noun default
 and returned to the caller.
 These two providers, at present, do not allow the caller to specify a projectio
n, selection arguments, or an ordering.
 These parameters are all biased towards a SQL-like model, and there is
 no simple way to apply them to a 
\noun on
MatrixCursor.

\noun default
 Some built-in Android content providers, such as the 
\noun on
gmail-ls
\noun default
 provider which facilitates access to the user's gmail account, also do
 not implement projection, selection or ordering; this suggests that in
 situations where the provider is not backed by a SQLite database, it is
 acceptable to just ignore these parameters.
 Of course, they would be more useful if the parameters were respected,
 so the implementation may be reconsidered in the future.
\end_layout

\begin_layout Subsubsection*
API class
\end_layout

\begin_layout Standard
In order to use receive intents or use content providers, developers need
 to know the URIs and key names data structures involved.
 These are published in the developer documentation (
\begin_inset CommandInset ref
LatexCommand prettyref
reference "sec:Developer-Guide"

\end_inset

), and an optional lightweight 
\begin_inset Quotes eld
\end_inset

API
\begin_inset Quotes erd
\end_inset

 is also provided to save developers having to hard code common String and
 URI values.
 This API, as discussed in the developer guide, consists of a set of nested
 public classes with public String and URI constants.
 Developers simply drop a single JAR archive or a single JAVA source file
 into their projects, and they can then access constants for the content
 provider URIs, column names for each exposed content provider, and intent
 names and metadata for broadcast intents.
\end_layout

\begin_layout Subsubsection*
Permissions
\end_layout

\begin_layout Standard
In order for the Context Analyser function, it has to ask the user for the
 relevant 
\emph on
permissions
\emph default
 to use the accelerometers, access their location, and keep the device awake.
 All of these permissions are classed as 
\begin_inset Quotes eld
\end_inset

dangerous
\begin_inset Quotes erd
\end_inset

 and are flagged to the user when they install the application.
 The Android OS enforces access control based on permissions, and will cause
 runtime exceptions to be thrown if applications attempt to access a resource
 they do not have access to.
\end_layout

\begin_layout Standard
In order to protect users' privacy, the Context Analyser defines its own
 set of permissions which third-party applications must request in order
 to retrieve context information.
 These permissions are all designated 
\begin_inset Quotes eld
\end_inset

dangerous
\begin_inset Quotes erd
\end_inset

 so that users will be aware of the information that applications are requesting.
 Without these permissions, the Context Analyser would open up a loophole
 whereby applications could retrieve location information from the Context
 API that they didn't have permission to access directly through the OS.
 The Android OS makes it extremely simple to enforce these permissions -
 in most cases a single tag is added in the application's manifest file,
 or a single method is invoked in code, and the OS handles everything else.
\end_layout

\begin_layout Standard
One extra permission was also created which is requested by the Context
 Analyser itself.
 This permission is called 
\begin_inset Quotes eld
\end_inset

BROADCAST
\begin_inset Quotes erd
\end_inset

 and is used to ensure data integrity for third party applications.
 Applications are encouraged to check for the 
\begin_inset Quotes eld
\end_inset

BROADCAST
\begin_inset Quotes erd
\end_inset

 permission when receiving broadcast intents (and again, the Android OS
 makes this as simple as adding a tag to an element in the manifest file)
 in order to ensure that the broadcasts came from a source that the user
 trusts to make them.
 This prevents malicious third-party applications broadcasting erroneous
 data, or broadcasting high volumes of data, to negatively impact context-aware
 applications.
\end_layout

\begin_layout Section
Places application
\end_layout

\begin_layout Standard
The 
\begin_inset Quotes eld
\end_inset

places
\begin_inset Quotes erd
\end_inset

 application consists of a single activity which shows an Android 
\noun on
MapView
\noun default
, with two custom overlay layers.
 One layer renders a star at the latitude/longitude of each place known
 to the 
\noun on
Context Analyser
\noun default
, while the second layer renders red lines between places that are connected
 by journeys.
 The thickness of the line is proportionate to the number of times the journey
 has been undertaken.
\end_layout

\begin_layout Standard
The application retrieves its data from two of the Context Analyser's content
 providers.
 For each location returned by the places content provider, the application
 creates a new 
\noun on
OverlayItem
\noun default
 containing the latitude/longitude, name, and a summary of the statistics
 associated with the place.
 The corresponding overlay shows a new 
\emph on
toast
\emph default
 containing the name and statistics when the user clicks on or near the
 overlay item (see 
\begin_inset CommandInset ref
LatexCommand prettyref
reference "fig:Place-details"

\end_inset

).
\end_layout

\begin_layout Standard
The journeys overlay constructs a 2-dimensional map of 
\noun on
OverlayItems
\noun default
 to 
\noun on
OverlayItems
\noun default
 to the number of times that journey has been performed (i.e., 
\noun on
Map<OverlayItem, Map<OverlayItem, Integer>>
\noun default
).
 It is passed a list of items created based on the places content provider,
 and then retrieves all known journeys from the journeys content provider
 and uses them to build the map.
 Journeys are normalised so that the ID of the start point is always less
 than the ID of the end point as the overlay is not concerned with direction.
\end_layout

\begin_layout Standard
As each 
\noun on
OverlayItem
\noun default
 holds the latitude and longitude of the point, it is therefore trivial
 to iterate over each pair of items, request the 
\noun on
MapView
\noun default
 translate the latitude/longitude into screen co-ordinates, and render a
 line between the two points.
 The line width is set such that the most traveled journey is 10 pixels
 wide, and all other journeys are scaled in proportion.
\end_layout

\begin_layout Section
Locale plugin
\end_layout

\begin_layout Standard
The locale plugin is a lightweight application which connects the 
\noun on
Context Analyser
\noun default
 to the third-party 
\noun on
Locale
\noun default
 software, which is designed to allow users to change settings of their
 device automatically when certain 
\begin_inset Quotes eld
\end_inset

situations
\begin_inset Quotes erd
\end_inset

 are encountered.
 By default, situations can include location, time, battery power, orientation
 and contact information.
 Many additional plugins are available on the Android Market to augment
 these conditions.
 The plugin for the Context Analyser allows users to add conditions for
 their current activity and (most likely) predicted destination.
\end_layout

\begin_layout Standard
In order to show new conditions in 
\noun on
Locale
\noun default
, the plugin simply has to define an activity which can handle a certain
 predefined intent.
 One such activity is created for each condition, and they simply provide
 a lightweight user interface to allow the user to select the options for
 the condition.
 The activity for selecting a destination, for example, queries the places
 content provider and displays the result in a combobox.
 The user then selects the desired place, and either presses their back
 button, or presses menu and taps 
\begin_inset Quotes eld
\end_inset

Save
\begin_inset Quotes erd
\end_inset

 (this is a slightly odd user interface, but it is a standard amongst 
\noun on
Locale 
\noun default
plugins and highly recommended by the 
\noun on
Locale
\noun default
 developers).
\end_layout

\begin_layout Standard
A broadcast receiver is then created which responds to queries from 
\noun on
Locale.

\noun default
 It does this by querying the prediction and activity content providers,
 and comparing the values they return with the values previously supplied
 for the condition by the user (these are stored in an Intent's 
\emph on
extra
\emph default
 fields, which are provided to the receiver by 
\noun on
Locale
\noun default
).
 It then sets a result code to indicate whether or not the situation is
 satisfied at present
\end_layout

\begin_layout Standard
The broadcast receiver also listens for intents from the content analyser,
 and sends a special intent to 
\noun on
Locale
\noun default
 to suggest that it should requery the plugin.
 This allows 
\noun on
Locale
\noun default
 to be aware of when conditions change, and adjust its schedule appropriately.
 This workflow also allows 
\noun on
Locale
\noun default
 to govern how often the conditions are queried, which allows it to reduce
 the impact on battery life.
\end_layout

\begin_layout Section
Context-aware Home Screen
\end_layout

\begin_layout Standard
The context-aware home screen took a substantial amount of development time.
 It is a replacement for the stock Android 'home' screen which not only
 gives the user access to their applications and contacts, but displays
 recent e-mails, text messages, upcoming appointments and missed calls.
 In addition to this, it learns and adapts to the user's behaviour in a
 context-sensitive fashion.
\end_layout

\begin_layout Standard
The context-aware home screen consists of a set of 
\begin_inset Quotes eld
\end_inset

modules
\begin_inset Quotes erd
\end_inset

 which each take up a small portion of the screen real estate.
 Each module displays one or more actionable items, such as a set of application
 shortcuts, an e-mail message, or a missed call.
 The home screen supports a number of 
\begin_inset Quotes eld
\end_inset

fixed
\begin_inset Quotes erd
\end_inset

 modules which are displayed at the top of the screen, and a set of other
 modules which are displayed below and may be scrolled vertically.
 This allows important or frequently used modules such as application shortcuts
 to be visible regardless of the other information displayed.
\end_layout

\begin_layout Standard
Each module is expected to tailor its behaviour to the user's current context,
 either by ordering its contents appropriately, or selectively displaying
 the most relevant content.
 For example, the application shortcut module will order the shortcuts by
 those it anticipates will be most likely to be used in the present context,
 whereas an e-mail module will chose to display the e-mail messages most
 likely to be read.
 In addition, modules which aren't fixed are ordered by the home screen
 according to the context and previous history.
\end_layout

\begin_layout Standard
The current context is represented as a set of tuples of context type and
 value.
 For example, a complete description of a context may be:
\end_layout

\begin_layout LyX-Code
(location,1),
\end_layout

\begin_layout LyX-Code
(destination,2),
\end_layout

\begin_layout LyX-Code
(activity,CLASSIFIED/WALKING),
\end_layout

\begin_layout LyX-Code
(day,Monday),
\end_layout

\begin_layout LyX-Code
(hour,14),
\end_layout

\begin_layout LyX-Code
(period,Afternoon)
\end_layout

\begin_layout Standard
When the user performs an action, a tuple consisting of the module name
 and a type and identifier for the action is created.
 It is then recorded against each tuple in the current context; so if the
 user tapped an e-mail with the label 
\begin_inset Quotes eld
\end_inset

work
\begin_inset Quotes erd
\end_inset

 in the above context, some of the generated tuples would be:
\end_layout

\begin_layout LyX-Code
(email,label,work,location,1),
\end_layout

\begin_layout LyX-Code
(email,label,work,destination,2),
\end_layout

\begin_layout LyX-Code
(email,label,work,activity,CLASSIFIED/WALKING),
\end_layout

\begin_layout LyX-Code
...
\end_layout

\begin_layout LyX-Code
(email,label,work,period,Afternoon)
\end_layout

\begin_layout Standard
Such an event would also cause similar data to be logged for the sender
 of the e-mail and the read state.
 A helper class is provided by the home screen activity to each module to
 facilitate storing and querying of such tuples.
 On the database level, each tuple is associated with a 
\emph on
count
\emph default
 - the number of times it has been generated by an event.
\end_layout

\begin_layout Standard
When a module is deciding how to arrange or select its contents, it queries
 for all tuples which match the current context.
 It can then sum the number of times each action occurred in a related context,
 and use this score in its selection or ordering algorithm.
 The same algorithm is applied to the ordering of modules on the home screen
 itself - each interaction is recorded as a tuple of 
\noun on
(homescreen, activity, <module>).
\end_layout

\begin_layout Standard
Some actions the user performs may be universal, rather than tied to a specific
 context.
 For example, a user is more likely to tap on an 
\emph on
unread
\emph default
 e-mail to read it than to tap an e-mail they've already seen.
 To compensate for this fact, a special context provider was introduced
 which constantly provides the tuple 
\noun on
(global, true).

\noun default
 This allows modules to seamlessly incorporate the total number of times
 an action was performed into their algorithms.
\end_layout

\begin_layout Standard
\begin_inset Newpage pagebreak
\end_inset


\end_layout

\begin_layout Part
\begin_inset CommandInset label
LatexCommand label
name "par:Evaluation"

\end_inset

Evaluation
\end_layout

\begin_layout Standard
This section contains exerts from the project specification and an evaluation
 of how well the goals were met.
\end_layout

\begin_layout Section
Activity classification
\end_layout

\begin_layout Quote
The classifier should be able to classify the following activities: walking,
 running, standing, sitting, traveling in a vehicle.
 ...
 It is expected that the classifier should correctly classify all activities
 with an accuracy of at least 70%, within 30 seconds of the activity being
 started.
\end_layout

\begin_layout Standard
The activity inference component of the context analyser is able to uniquely
 identify all of the activities stated in the specification, with the exception
 of running.
 In addition, it can distinguish between traveling by car and bus, and walking
 up or down stairs.
 Of over 1,000 data samples submitted by users, not a single one was described
 as 
\begin_inset Quotes eld
\end_inset

running
\begin_inset Quotes erd
\end_inset

, which suggests that the omission has not negatively impacted the project
 in any way.
\end_layout

\begin_layout Standard
The accuracy of the classifier when presented with supported activities
 is over 75% (see 
\begin_inset CommandInset ref
LatexCommand prettyref
reference "sub:Market-and-user"

\end_inset

).
 This was all accomplished by using just two features extracted from two
 axes of the accelerometer; typical research applications that achieve similar
 accuracies often use hundreds of features and combine many different sensors.
\end_layout

\begin_layout Standard
The timescale for activity detection was consciously expanded during this
 project.
 To conserve battery life, polling was reduced to once a minute, and the
 aggregation of results adds a further delay to activities being classified.
 Brief tests with the context analyser suggest that activities take 2-3
 minutes to be correctly identified.
 The change in timescale reflects a shift in aims from enabling applications
 to respond instantaneously to user activity (of which there are few genuine
 use cases) to facilitating a less obvious background enhancement of application
s, as seen in the context home screen application.
\end_layout

\begin_layout Section
Experimentation
\end_layout

\begin_layout Quote
The results of the experimentation described should be written up as a report.
 The reports must include the data collected in each of the experiments,
 the conclusions drawn from those, and the impact of the results of the
 experiment on the project deliverables.
\end_layout

\begin_layout Standard
Several experiments were performed as part of the project.
 These include investigating Bluetooth ubiquity (
\begin_inset CommandInset ref
LatexCommand prettyref
reference "sec:Bluetooth-1"

\end_inset

) and methods of determining whether or not a device is indoors (
\begin_inset CommandInset ref
LatexCommand prettyref
reference "sec:Use-of-GPS/GSM"

\end_inset

).
 Consideration was also given to the use of data from a camera input (
\begin_inset CommandInset ref
LatexCommand prettyref
reference "sec:Camera"

\end_inset

), and functioning code was developed to use a Microphone input (
\begin_inset CommandInset ref
LatexCommand prettyref
reference "sec:Microphone"

\end_inset

).
\end_layout

\begin_layout Standard
Ultimately, none of these experiments contributed positively to the end
 product.
 The experimentation did, however, save development time which would have
 been spent on features that would probably have not helped the project.
 The lack of positive results, while acceptable according to the specification,
 suggests that other areas should have been considered or alternative approaches
 attempted.
 Some possibilities for these are discussed in 
\begin_inset CommandInset ref
LatexCommand prettyref
reference "sec:Future-work"

\end_inset

.
\end_layout

\begin_layout Section
Deliverables
\end_layout

\begin_layout Quote
The following items should be delivered: ...
 Context-aware Framework, ...
 Activity condition for Locale, ...
 Context-aware home screen.
\end_layout

\begin_layout Standard
A total of four (final) applications were delivered, along with two applications
 used during the development process.
 All three applications required by the specification were successfully
 implemented, along with the 
\begin_inset Quotes eld
\end_inset

Places
\begin_inset Quotes erd
\end_inset

 application which exposes some functionality of the context API which would
 otherwise be hidden from the user.
\end_layout

\begin_layout Quote
The application should provide two different interfaces to retrieve the
 user's context.
 The first should be an implementation of the Android ContentProvider interface.
 The second interface should use Android broadcast Intents to notify any
 interested application whenever the user's activity changes.
\end_layout

\begin_layout Standard
The API provided by the Context Analyser exposes a total of four content
 providers, and makes use of three different broadcast intents.
 These are employed by the Places application, Locale plugin, and context
 home screen.
 The two methods compliment each other and facilitate two different methods
 of interfacing very well.
\end_layout

\begin_layout Section
Testing
\end_layout

\begin_layout Quote
Throughout the development of the project, unit tests should be created
 to test key functionality of all applications.
 It is expected that at the completion of the project, all unit tests should
 pass successfully, and they will have a code coverage of 80% or above.
\end_layout

\begin_layout Standard
While unit tests were employed throughout the project, the emphasis was
 on testing small parts of complex or potentially unstable code, and code
 which was not easily covered by systems tests.
 Tests were split between those ran on a standard JVM from the development
 environment, and those that needed to be ran on the device itself with
 an Android-specific test harness.
 While no figure for code coverage is available due to this split, and due
 to lack of coverage tools for the latter type of tests, it is expected
 that the figure would be well below 80% line coverage.
\end_layout

\begin_layout Standard
This represents a failure to adhere to Test-Driven Development (TDD) as
 originally intended (but not documented).
 This involves writing unit tests as a form of 
\begin_inset Quotes eld
\end_inset

specification
\begin_inset Quotes erd
\end_inset

 before implementing the unit itself.
 With this project, however, a lot of code started out as small 
\begin_inset Quotes eld
\end_inset

experiments
\begin_inset Quotes erd
\end_inset

 to determine whether or not something would work, or the exact output of
 some built-in functionality; it then evolved into a full implementation,
 and adding unit tests after the fact was not considered a high priority
 for most code.
\end_layout

\begin_layout Quote
The classifier application should also have a suite of system tests.
 These should consist of a set of fake or pre-recorded inputs which are
 fed into the application in place of raw sensor data.
 The output of the classifier can then be compared to expected output for
 the data.
\end_layout

\begin_layout Standard
The input sources for the framework are all located behind factory classes.
 These classes are able to switch out the real information for a stubbed
 version which simulates the data being received; this is automatically
 done if the application is ran on the Android Emulator, which does not
 emulate sensor inputs of any kind.
 The stubbed classes allow for easy testing of the context framework and
 the applications that use it, which makes for verification of the whole
 system extremely easy.
\end_layout

\begin_layout Section
User testing and feedback
\end_layout

\begin_layout Quote
The Locale addon and context-aware home screen should be subject to user
 acceptance testing for evaluation.
 This should take the form of providing the applications to multiple end
 users, allowing them to use them for a period of time (providing instructions
 for certain tasks to complete).
 The users should then be presented with a questionnaire which they can
 use to evaluate the functionality, utility and design of the applications.
 ...
 In addition to providing the applications to a closed set of users, the
 applications should be published to the Android market.
\end_layout

\begin_layout Standard
All four 
\noun on
Context Analyser
\noun default
 applications were given to a small group of test users, along with copies
 of the user manuals and developer's guide.
 No questionnaires were used, but the users were asked to give feedback
 and evaluate.
 Both of the preliminary data gathering applications were published to the
 Android Market where they received comments and ratings by users.
 At the time of writing, the 
\noun on
Context Analyser
\noun default
 suite had not yet been published to the market.
\end_layout

\begin_layout Standard
The two test applications published to the market, which were never intended
 to be particularly valuable to end users, had between 100 and 500 downloads,
 and both received an average rating between 3 and 4 stars (annotated as
 
\begin_inset Quotes eld
\end_inset

Average
\begin_inset Quotes erd
\end_inset

 and 
\begin_inset Quotes eld
\end_inset

Above Average
\begin_inset Quotes erd
\end_inset

 within the Market UI, respectively).
 Some positive comments were left, such as the following comment regarding
 the Sensor Logger application:
\end_layout

\begin_layout Quote
It works on myTouch3G but it would be better if it ran in background and
 actually kept a log of what you do throughout the day.
 At least it was right!
\end_layout

\begin_layout Standard
Negative feedback mostly revolved around activities which the applications
 were not trained for being incorrectly classified.
 As evidenced with the annotated data which was submitted, a lot of users
 attempted to get the application to classify them sleeping, and were presented
 with seemingly bizarre results such as 
\begin_inset Quotes eld
\end_inset

Traveling by bus
\begin_inset Quotes erd
\end_inset

.
 This is because one sample for traveling by bus was close to a 
\begin_inset Quotes eld
\end_inset

stationary
\begin_inset Quotes erd
\end_inset

 reading - a vertical acceleration of 9.8m/s, no horizontal acceleration,
 and little variance.
\end_layout

\begin_layout Standard
Methods to correct or detect this type of erroneous result would have given
 a much better user experience, and reduced the small amount of negative
 feedback received, but no such methods were attempted during this project.
 This was because early testing ignored activities which the classifier
 did not know of, and realisation of the scope of the problem came too late
 into the project to make the changes necessary.
 Some ideas for combating this problem are presented in 
\begin_inset CommandInset ref
LatexCommand prettyref
reference "sec:Future-work"

\end_inset

.
\end_layout

\begin_layout Standard
\begin_inset Note Note
status open

\begin_layout Plain Layout
Resource usage
\end_layout

\end_inset


\end_layout

\begin_layout Standard
\begin_inset Newpage pagebreak
\end_inset


\end_layout

\begin_layout Part
\begin_inset CommandInset label
LatexCommand label
name "par:Conclusion"

\end_inset

Conclusion
\end_layout

\begin_layout Section
Project outcomes
\end_layout

\begin_layout Standard
A context-aware API has been developed for the Android platform.
 This was the primary purpose and output of this project, and it has been
 evaluated to perform to an acceptable accuracy.
 While not all of the evaluation targets were met, a number of these were
 conscious decisions to deviate from the previous specification in response
 to a change in development method or change in target audience.
\end_layout

\begin_layout Standard
In developing the API, an algorithm to classify accelerometer data using
 an extremely small set of extracted features was devised.
 This is a significant deviation from established works in the field, which
 mostly attempt to use as many features as possible in an attempt to increase
 accuracy.
 
\end_layout

\begin_layout Standard
In addition to the main API, the project has also delivered a set of application
s built on top of it, most notably the context aware home screen.
 This clearly demonstrates how context-aware systems can enhance a user's
 experience by tailoring content and behaviour to the current context.
\end_layout

\begin_layout Section
Future work
\begin_inset CommandInset label
LatexCommand label
name "sec:Future-work"

\end_inset


\end_layout

\begin_layout Standard
There are many areas in this project which could be expanded on or enhanced
 in some way.
 Some of these are discussed below.
\end_layout

\begin_layout Subsection
Using GSM metadata to enhance activity classification
\end_layout

\begin_layout Standard
While experiments with using GSM and GPS signal strength to determine interestin
g locations were unsuccessful, there is a possibility that some GSM data
 can be used in order to augment the existing activity classification system.
 In order to promptly hand off communications to alternative cell sites
 when the user moves around, all mobile telephones track the cell IDs and
 signal strengths of their 
\emph on
neighbouring
\emph default
 cell towers as well as the current one.
\end_layout

\begin_layout Standard
It is possible that measuring the rate of change in either the strength
 of neighbouring cell towers, or indeed the change in cell towers themselves,
 could be used to infer the approximate speed the user is traveling at.
 While this could be a piece of standalone contextual information, it would
 be possible to integrate this with the activity inference system to help
 reduce incorrect results.
\end_layout

\begin_layout Standard
As discussed earlier, a large percentage of incorrectly classified samples
 involved the user sitting down and being misclassified as being in a vehicle.
 A simple decision tree could be implemented that biased the activity inference
 algorithm to favour the 
\begin_inset Quotes eld
\end_inset

sitting
\begin_inset Quotes erd
\end_inset

 classification over vehicle-based ones if the user was not moving at speed.
 This has the potential to increase accuracy to the region of 90%.
\end_layout

\begin_layout Subsection
Automatic classification of places
\end_layout

\begin_layout Standard
While the context analyser correctly identifies interesting places, it would
 be useful to know what type of place they were.
 
\begin_inset Quotes eld
\end_inset

Home
\begin_inset Quotes erd
\end_inset

 and 
\begin_inset Quotes eld
\end_inset

Work
\begin_inset Quotes erd
\end_inset

 could potentially be inferred by the times of day spent at each location;
 interchanges could be identified by the duration of visits and the activity
 involved in getting to and from the location, etc.
\end_layout

\begin_layout Standard
This would enhance the behaviour of contextual location-aware services,
 which currently have to rely on analysing the user's activity (either their
 real life activity or their interactions with the phone) in order to correctly
 adapt their behaviour to places.
 Instead of observing that a user frequently reads e-mails at place #17,
 an application could infer that as place #17 is a work place, the user
 is more likely to want to read e-mail than play games.
\end_layout

\begin_layout Subsection
On-device training for new activities
\end_layout

\begin_layout Standard
Because it uses an instance-based learning algorithm, it would be very easy
 to add new samples to the activity classification model on the device itself.
 However, there are various challenges which would make this more difficult.
 At present the model data is stored in a binary file bundled with the Context
 Analyser; this means that it is not modifiable at runtime.
 In order to integrate new data, it would either have to be extracted to
 storage on the device and then modified, or imported into a database.
\end_layout

\begin_layout Standard
In addition, it would be hard to ensure that data entered on the device
 was of a good quality.
 Without a way to explore the model itself, the user has no way of finding
 and correcting or deleting poor quality training samples which lead to
 false classifications.
 Finally, removing the developer from the update process means that new
 activities have to be added by each and every user, instead of added once
 by the developer and shared to all users.
 Further work on this topic would have to explore ways to allow users to
 add high quality data, and then ensure that data is shared appropriately.
\end_layout

\begin_layout Subsection
\begin_inset Quotes eld
\end_inset

Omniscient
\begin_inset Quotes erd
\end_inset

 context home screen
\end_layout

\begin_layout Standard
The present context home screen only records what happens when the user
 directly interacts with it.
 Further work could expand this to make the home screen aware of all actions
 that were performed on the device, and to incorporate these into the dashboard
 to further improve the user experience.
\end_layout

\begin_layout Standard
An obvious example of this is monitoring outgoing phone calls, which can
 be invoked from a multitude of applications without directly tapping the
 contact on the home screen.
 At present, the home screen sees a tap on the 
\begin_inset Quotes eld
\end_inset

Dialer
\begin_inset Quotes erd
\end_inset

 application (for example) and nothing else; if it monitored phone calls
 and other activities it could also make the contact involved more prominent
 on the home screen.
\end_layout

\begin_layout Standard
Another use would be monitoring the time spent in applications (rather than
 just the number of launches), and which activities within those are accessed.
 If a user repeatedly opens the market application to browse to the most
 recently added games, the context home screen may be able to detect that
 behaviour and automatically add a 
\emph on
new
\emph default
 shortcut which performs this action automatically for them.
 Work would need to be done in order to determine whether or not this was
 possible in a general case for any application.
\end_layout

\begin_layout Standard
\begin_inset Newpage pagebreak
\end_inset


\end_layout

\begin_layout Part
Appendices
\end_layout

\begin_layout Section
\start_of_appendix
User Guide - Context Analyser
\end_layout

\begin_layout Standard
Welcome to the 
\noun on
Context Analyser
\noun default
.
 This application analyses your 
\emph on
context
\emph default
 as you carry your phone around with you performing day-to-day activities.
 Other applications can query your context information and enhance their
 behaviour so that they're more relevant to what you're doing.
\end_layout

\begin_layout Standard
The context analyser currently provides the following context information:
\end_layout

\begin_layout Itemize
Your activity
\end_layout

\begin_layout Itemize
Your location
\end_layout

\begin_layout Itemize
Your predicted destination, if you're not at a known location
\end_layout

\begin_layout Standard
It does this by gathering data from your phone's accelerometers and location
 provider.
 Data is recorded for a few seconds once a minute, to preserve your battery
 life.
\end_layout

\begin_layout Standard
For your 'activity', the context analyser tries to detect whether you are
 walking, sitting, standing, or in a vehicle.
 It can also expand on these to detect the difference between a car and
 a bus, and walking normally and walking up or down stairs.
 Future updates may add more activities.
\end_layout

\begin_layout Standard
For your location and destination, the context analyser deals in 'places'.
 These are locations up to 500m wide where you have spent several minutes
 not moving.
 A place could correspond to your home, office, favourite coffee shop or
 a bus stop you frequently wait at.
 When you move between places, the context analyser notes which activities
 it thought you were performing, and stores these as a 'journey' which links
 the two places.
 When you next set off from one of these, it can compare your activities
 and see if it can guess where you're heading.
\end_layout

\begin_layout Standard
There is very little you can do with the context analyser on its own.
 It's built as a tool for other applications to hook into.
 
\begin_inset Float figure
wide false
sideways false
status collapsed

\begin_layout Plain Layout
\begin_inset Graphics
	filename contextanalyser-featured.png

\end_inset


\end_layout

\begin_layout Plain Layout
\begin_inset Caption

\begin_layout Plain Layout
Featured applications
\begin_inset CommandInset label
LatexCommand label
name "fig:Featured-applications"

\end_inset


\end_layout

\end_inset


\end_layout

\end_inset

You can see some of these featured applications listed when you open the
 context analyser (see 
\begin_inset CommandInset ref
LatexCommand prettyref
reference "fig:Featured-applications"

\end_inset

) .
 Simply click on one of them and the Android market will open for you to
 view or install your chosen app.
\end_layout

\begin_layout Standard
\begin_inset Float figure
wide false
sideways false
status collapsed

\begin_layout Plain Layout
\begin_inset Graphics
	filename contextanalyser-menu.png

\end_inset


\begin_inset Caption

\begin_layout Plain Layout
Disable service button
\begin_inset CommandInset label
LatexCommand label
name "fig:Disable-service-button"

\end_inset


\end_layout

\end_inset


\end_layout

\end_inset

The context analyser will run a background service as soon as you open the
 application, or whenever another application requests data from it.
 If you wish to disable the background service (which will stop the context
 analyser from detecting places or determining your activity), press the
 
\noun on
menu
\noun default
 button and select the 
\noun on
Disable service
\noun default
 option (see 
\begin_inset CommandInset ref
LatexCommand prettyref
reference "fig:Disable-service-button"

\end_inset

).
 The background service will not run until you repeat the procedure and
 select 
\noun on
Enable service
\noun default
.
\begin_inset Newpage pagebreak
\end_inset


\end_layout

\begin_layout Section
User Guide - Places
\end_layout

\begin_layout Standard
The 
\noun on
places
\noun default
 application shows you all of the places detected by the 
\noun on
Context Analyser
\noun default
, and the journeys you make in between them.
 The 
\noun on
Context Analyser
\noun default
 is a tool which tries to determine your current activity and location,
 and your destination if you're on the move.
 If you don't have the 
\noun on
Context Analyser
\noun default
 installed, you'll be prompted to install it from the market.
\end_layout

\begin_layout Standard
\begin_inset Float figure
wide false
sideways false
status collapsed

\begin_layout Plain Layout
\begin_inset Graphics
	filename places-normal.png

\end_inset


\end_layout

\begin_layout Plain Layout
\begin_inset Caption

\begin_layout Plain Layout
Places application
\begin_inset CommandInset label
LatexCommand label
name "fig:Places-application"

\end_inset


\end_layout

\end_inset


\end_layout

\begin_layout Plain Layout

\end_layout

\end_inset

The places application displays a map and marks each detected place with
 an orange star.
 Places you've traveled between are connected with a red line - the thicker
 the line, the more frequently you make that journey.
 In 
\begin_inset CommandInset ref
LatexCommand prettyref
reference "fig:Places-application"

\end_inset

, you can see two places with a very frequently made journey between them.
\end_layout

\begin_layout Standard
You can pan the map by dragging it around with your finger, or by moving
 your phone's trackball (if it has one).
 To zoom in and out, tap the screen and wait two seconds and the zoom controls
 will appear at the bottom of the map.
 Simply tap either button to zoom in or out.
\end_layout

\begin_layout Standard
\begin_inset Float figure
wide false
sideways false
status collapsed

\begin_layout Plain Layout
\begin_inset Graphics
	filename places-toast.png

\end_inset


\end_layout

\begin_layout Plain Layout
\begin_inset Caption

\begin_layout Plain Layout
Place details
\begin_inset CommandInset label
LatexCommand label
name "fig:Place-details"

\end_inset


\end_layout

\end_inset


\end_layout

\begin_layout Plain Layout

\end_layout

\end_inset

To see more information about a place, simply tap on its star.
 A small 
\emph on
toast
\emph default
 will appear giving you the name of the place, the number of visits, and
 the date and time of your last visit.
 Names are determined automatically by geocoding the latitude and longitude
 to a nearby place name - this could be the name of a street, a nearby landmark
 or a side alley.
 
\begin_inset CommandInset ref
LatexCommand prettyref
reference "fig:Place-details"

\end_inset

 shows the result of tapping one of the stars - the name of the place is
 
\begin_inset Quotes eld
\end_inset

Rose Alley
\begin_inset Quotes erd
\end_inset

, it has been visited 37 times and the last time this happened was in the
 early hours of July the 10th.
\begin_inset Newpage pagebreak
\end_inset


\end_layout

\begin_layout Section
User Guide - Locale plugin
\end_layout

\begin_layout Standard
The 
\noun on
Context Analyser
\noun default
 plugin for 
\noun on
Locale
\noun default
 allows you to create 
\noun on
Locale
\noun default
 situations based on information provided by the 
\noun on
Context Analyser
\noun default
.
 
\noun on
Locale
\noun default
 is an application which allows you to make your phone change settings,
 send tweets, or perform a variety of other actions, whenever a certain
 'situation' occurs.
 A situation is just a set of conditions - such as your location, your phone's
 battery life, or the current time.
 The 
\noun on
Context Analyser
\noun default
 application automatically determines your current activity (such as 'walking'
 or 'sitting down'), and your predicted destination if you're traveling.
 This plugin requires that you have both 
\noun on
Context Analyser
\noun default
 and 
\noun on
Locale
\noun default
 installed.
 Both are available from the Android market.
\end_layout

\begin_layout Standard
The plugin adds two new conditions which you can use in 
\noun on
Locale
\noun default
 situations:
\end_layout

\begin_layout Itemize
Activity - the activity you are 
\emph on
most likely
\emph default
 performing
\end_layout

\begin_layout Itemize
Destination - your 
\emph on
most likely
\emph default
 destination, if you're not at a known location
\end_layout

\begin_layout Standard
A basic overview of adding these new conditions follows.
 For full documentation on how to use 
\noun on
Locale
\noun default
, consult the 
\noun on
Locale 
\noun default
user manual.
\end_layout

\begin_layout Standard
\begin_inset Float figure
wide false
sideways false
status collapsed

\begin_layout Plain Layout
\begin_inset Graphics
	filename locale-situations.png

\end_inset


\end_layout

\begin_layout Plain Layout
\begin_inset Caption

\begin_layout Plain Layout
Locale main screen
\begin_inset CommandInset label
LatexCommand label
name "fig:Locale-main-screen"

\end_inset


\end_layout

\end_inset


\end_layout

\begin_layout Plain Layout

\end_layout

\end_inset

When you open 
\noun on
Locale
\noun default
, you will see a list of currently defined situations (
\begin_inset CommandInset ref
LatexCommand prettyref
reference "fig:Locale-main-screen"

\end_inset

).
 You can edit existing situations by tapping on them.
 Existing situations may be deleted by clicking on the red minus button
 to the right of the situation name.
 Finally, new situations can be created by tapping the 'Add Situation' button
 at the bottom of the screen.
 
\noun on
Locale 
\noun default
shows any situations that are 
\emph on
active
\emph default
 (all the conditions currently hold true) in bold.
\end_layout

\begin_layout Standard
\begin_inset Float figure
wide false
sideways false
status collapsed

\begin_layout Plain Layout
\begin_inset Graphics
	filename locale-situation-pre.png

\end_inset


\end_layout

\begin_layout Plain Layout
\begin_inset Caption

\begin_layout Plain Layout
Locale editing situation
\begin_inset CommandInset label
LatexCommand label
name "fig:Locale-editing-situation"

\end_inset


\end_layout

\end_inset


\end_layout

\begin_layout Plain Layout

\end_layout

\end_inset


\begin_inset Float figure
wide false
sideways false
status collapsed

\begin_layout Plain Layout
\begin_inset Graphics
	filename locale-add-condition.png

\end_inset


\end_layout

\begin_layout Plain Layout
\begin_inset Caption

\begin_layout Plain Layout
Locale add condition popup
\begin_inset CommandInset label
LatexCommand label
name "fig:Locale-add-condition"

\end_inset


\end_layout

\end_inset


\end_layout

\begin_layout Plain Layout

\end_layout

\end_inset

Once you've selected a situation to edit, or created a brand new situation,
 you will see 
\noun on
Locale
\noun default
's 'edit situation' screen (
\begin_inset CommandInset ref
LatexCommand prettyref
reference "fig:Locale-editing-situation"

\end_inset

).
 This allows you to set the name of the situation, add or edit conditions,
 and add or edit settings.
 The 
\noun on
Context Analyser
\noun default
 plugin adds two new conditions, which are shown in the list when you click
 'Add condition' (
\begin_inset CommandInset ref
LatexCommand prettyref
reference "fig:Locale-add-condition"

\end_inset

).
 Select either 'Activity' or 'Destination' to add a new condition based
 on your current context.
\end_layout

\begin_layout Standard
\begin_inset Float figure
wide false
sideways false
status collapsed

\begin_layout Plain Layout
\begin_inset Graphics
	filename locale-select-destination.png

\end_inset


\end_layout

\begin_layout Plain Layout
\begin_inset Caption

\begin_layout Plain Layout
Locale plugin selecting destination
\begin_inset CommandInset label
LatexCommand label
name "fig:Locale-plugin-selecting"

\end_inset


\end_layout

\end_inset


\end_layout

\begin_layout Plain Layout

\end_layout

\end_inset


\begin_inset Float figure
wide false
sideways false
status collapsed

\begin_layout Plain Layout
\begin_inset Graphics
	filename locale-select-activity.png

\end_inset


\end_layout

\begin_layout Plain Layout
\begin_inset Caption

\begin_layout Plain Layout
Locale plugin selecting activity
\begin_inset CommandInset label
LatexCommand label
name "fig:Locale-plugin-selecting-activity"

\end_inset


\end_layout

\end_inset


\end_layout

\begin_layout Plain Layout

\end_layout

\end_inset

When you select one of the plugin's conditions, you will be presented with
 a screen which allows you to specify which activity (see 
\begin_inset CommandInset ref
LatexCommand prettyref
reference "fig:Locale-plugin-selecting-activity"

\end_inset

) or destination (see 
\begin_inset CommandInset ref
LatexCommand prettyref
reference "fig:Locale-plugin-selecting"

\end_inset

) you wish to match.
 For activities, you can select one of sitting, standing, walking, walking
 up stairs, walking down stairs, dancing, traveling bar car, or traveling
 by bus.
 For destination, you may select any place which the 
\noun on
Context Analyser
\noun default
 has previously detected.
\end_layout

\begin_layout Standard
\begin_inset Float figure
wide false
sideways false
status collapsed

\begin_layout Plain Layout
\begin_inset Graphics
	filename locale-menu.png

\end_inset


\end_layout

\begin_layout Plain Layout
\begin_inset Caption

\begin_layout Plain Layout
Locale condition editor menu
\begin_inset CommandInset label
LatexCommand label
name "fig:Locale-condition-editor"

\end_inset


\end_layout

\end_inset


\end_layout

\end_inset

Once you've selected your chosen activity or destination, press the 
\noun on
menu
\noun default
 button and select the 'Save Changes' option (see 
\begin_inset CommandInset ref
LatexCommand prettyref
reference "fig:Locale-condition-editor"

\end_inset

).
 You will then return to the situation editor where the new condition will
 be displayed.
 You may then add settings as with any other 
\noun on
Locale
\noun default
 situation, and 
\noun on
Locale
\noun default
 will automatically apply these when all of the conditions match.
\end_layout

\begin_layout Standard
\begin_inset Newpage pagebreak
\end_inset


\end_layout

\begin_layout Section
User Guide - Context Home Screen
\end_layout

\begin_layout Standard
The 
\begin_inset Quotes eld
\end_inset

context-aware home screen
\begin_inset Quotes erd
\end_inset

 replaces your phone's normal home screen with an information rich dashboard
 which can adapt to offer different information based on your current context.
 As you use the home screen (by, for example, launching applications, opening
 e-mails, etc), the home screen remembers what you were doing, when you
 did it, and where you were at the time.
 It then applies this information to automatically make the shortcuts or
 messages it thinks you will be most interested in more prominent.
\end_layout

\begin_layout Standard
\begin_inset Float figure
wide false
sideways false
status collapsed

\begin_layout Plain Layout
\begin_inset Graphics
	filename home-select.png

\end_inset


\end_layout

\begin_layout Plain Layout
\begin_inset Caption

\begin_layout Plain Layout
Home screen selection
\begin_inset CommandInset label
LatexCommand label
name "fig:Home-screen-selection"

\end_inset


\end_layout

\end_inset


\end_layout

\begin_layout Plain Layout

\end_layout

\end_inset

Once the context-aware home screen is installed, pressing the 
\begin_inset Quotes eld
\end_inset

Home
\begin_inset Quotes erd
\end_inset

 key or turning on your device will prompt you as to which application you
 wish to provide the 
\begin_inset Quotes eld
\end_inset

Home
\begin_inset Quotes erd
\end_inset

 functionality, as seen in 
\begin_inset CommandInset ref
LatexCommand prettyref
reference "fig:Home-screen-selection"

\end_inset

.
 Select 
\begin_inset Quotes eld
\end_inset

Context Home
\begin_inset Quotes erd
\end_inset

 to open the context home screen.
 If you want this to 
\emph on
always
\emph default
 open when you press home, tick the 
\begin_inset Quotes eld
\end_inset

Use by default for this action
\begin_inset Quotes erd
\end_inset

 checkbox at the bottom of the prompt before making your choice.
\end_layout

\begin_layout Standard
\begin_inset Float figure
wide false
sideways false
status collapsed

\begin_layout Plain Layout
\begin_inset Graphics
	filename home-main.png

\end_inset


\end_layout

\begin_layout Plain Layout
\begin_inset Caption

\begin_layout Plain Layout
Context home screen
\begin_inset CommandInset label
LatexCommand label
name "fig:Context-home-screen"

\end_inset


\end_layout

\end_inset


\end_layout

\begin_layout Plain Layout

\end_layout

\end_inset

The context home screen is shown in 
\begin_inset CommandInset ref
LatexCommand prettyref
reference "fig:Context-home-screen"

\end_inset

.
 The top two lines of the home screen show shortcuts for your installed
 applications and contacts who have pictures associated with them.
 You can open the application or contact information screen by tapping on
 the appropriate image.
 To scroll left or right, simply drag your finger across the shortcuts.
 You may also use your device's trackball to navigate around the screen,
 if it has one.
\end_layout

\begin_layout Standard
The rest of the home screen shows you your recent e-mails, text messages,
 appointments, missed calls, and other information.
 You can scroll up and down in this area by dragging your finger up or down.
 Tapping on an item will open it in the relevant application.
 The context home screen will attempt to show contact pictures for each
 event where they are available; if the sender is not associated with a
 contact, or the contact has no photograph, then a white 
\begin_inset Quotes eld
\end_inset

running man
\begin_inset Quotes erd
\end_inset

 will be displayed.
\end_layout

\begin_layout Standard
As you use the context home screen, you should notice that the applications
 you use most frequently start appearing nearer to the start of the list
 and the types of event that you click on trickle up towards the top of
 the screen.
 If you regularly call someone every Saturday evening, you should find that
 person at the top of your contacts list when you look on Saturday evening.
 The more you use the context home screen, the better it adapts to your
 needs!
\end_layout

\begin_layout Standard
\begin_inset Newpage pagebreak
\end_inset


\end_layout

\begin_layout Section
Developer Guide
\begin_inset CommandInset label
LatexCommand label
name "sec:Developer-Guide"

\end_inset


\end_layout

\begin_layout Standard
This guide details how you can integrate the data made available by the
 
\noun on
Context Analyser
\noun default
 into your own applications.
 It is expected that you are familiar with Android application development
 and general concepts.
 For an overview of how the 
\noun on
Context Analyser 
\noun default
works, please consult the user guide.
\end_layout

\begin_layout Standard
The 
\noun on
Context Analyser
\noun default
 exposes its data via a set of Content Providers.
 These are augmented by several broadcast intents which can be used by third
 party applications to receive immediate notification when the user's context
 changes.
 
\end_layout

\begin_layout Subsection
Permissions
\begin_inset CommandInset label
LatexCommand label
name "sub:Permissions"

\end_inset


\end_layout

\begin_layout Standard
In order to protect the user's privacy, a series of permissions are defined
 by the 
\noun on
Context Analyser
\noun default
, and access to data and broadcast intents is limited to applications which
 hold the appropriate permissions.
 The 
\noun on
Context Analyser
\noun default
 defines the following permissions:
\end_layout

\begin_layout Itemize
uk.co.md87.android.contextanalyser.RECEIVE_UPDATES - allows the application to
 receive real-time updates about context or place information through broadcast
 intents
\end_layout

\begin_layout Itemize
uk.co.md87.android.contextanalyser.READ_PLACES - allows the application to read
 places from the relevant content provider
\end_layout

\begin_layout Itemize
uk.co.md87.android.contextanalyser.WRITE_PLACES - allows the application to modify
 places via the relevant content provider
\end_layout

\begin_layout Itemize
uk.co.md87.android.contextanalyser.READ_JOURNEYS - allows the application to
 read journey information from the relevant content providers
\end_layout

\begin_layout Itemize
uk.co.md87.android.contextanalyser.WRITE_JOURNEYS - allows the application to
 modify journey information via the relevant content providers
\end_layout

\begin_layout Itemize
uk.co.md87.android.contextanalyser.BROADCAST - permission used when broadcasting
 context-related intents.
 Applications may wish to check that broadcasters hold this permission to
 prevent third parties broadcasting erroneous data.
\end_layout

\begin_layout Standard
If you do not declare the required permissions, a run time error will occur
 when your application attempts to access protected data.
 All permissions listed here are defined as 
\noun on
dangerous
\noun default
, which means that end users will be prompted about them when installing
 any application using them; this is in line with the underlying accelerometer
 and location permissions.
\end_layout

\begin_layout Subsection
Model
\end_layout

\begin_layout Standard
The 
\noun on
Context Analyser
\noun default
 is backed by a database containing tables for 
\emph on
places
\emph default
, 
\emph on
journeys
\emph default
 and 
\emph on
journey steps
\emph default
.
 Activities and predictions are stored in memory.
\end_layout

\begin_layout Standard
A 
\series bold
place
\series default
 is a location represented by a latitude/longitude tuple.
 Places have a radius of 500 metres; whenever a user moves to within 500
 metres of a known place, they are assumed to be located at that place.
 New places are identified when the user is observed to be in the same location
 (within 500 metres) for three consecutive readings, which occur at 1 minute
 intervals.
 Places also have an associated name, which is initially set to a string
 representation of the latitude and longitude; the 
\noun on
Context Analyser
\noun default
 will attempt to rename any place with such a name by geocoding the latitude/lon
gitude into a nearby street or landmark name.
\end_layout

\begin_layout Standard
An 
\series bold
activity
\series default
 is represented by a string delimited by forward slashes (
\noun on
/
\noun default
).
 This forms a hierarchy of classifications, with the following possible
 values:
\end_layout

\begin_layout Itemize
CLASSIFIED/DANCING
\end_layout

\begin_layout Itemize
CLASSIFIED/IDLE/SITTING
\end_layout

\begin_layout Itemize
CLASSIFIED/IDLE/STANDING
\end_layout

\begin_layout Itemize
CLASSIFIED/VEHICLE/BUS
\end_layout

\begin_layout Itemize
CLASSIFIED/VEHICLE/CAR
\end_layout

\begin_layout Itemize
CLASSIFIED/WALKING
\end_layout

\begin_layout Itemize
CLASSIFIED/WALKING/STAIRS/DOWN
\end_layout

\begin_layout Itemize
CLASSIFIED/WALKING/STAIRS/UP
\end_layout

\begin_layout Standard
It is possible for activities to contain only a part of the hierarchy -
 for example if the readings alternate between classifications for traveling
 by bus and by car, they will be aggregated and the resulting activity will
 be simply CLASSIFIED/VEHICLE
\noun on
.

\noun default
 Similarly, if the user's activity is in constant flux, the resulting activity
 will be aggregated to simply 'CLASSIFIED'.
\end_layout

\begin_layout Standard
A 
\series bold
journey
\series default
 is a recorded sequence of activities which occurred when the user moved
 from one place to another.
 Whenever the user leaves a known place, the 
\noun on
Context Analyser
\noun default
 begins a log of activities; when they then reach another known place, the
 log is converted into a journey.
 Each journey consists of a sequence of 
\series bold
journey steps
\series default
, which describe a single activity and a number of repetitions.
\end_layout

\begin_layout Standard
For example, if the user leaves place A, spends five minutes walking, then
 ten minutes on a bus, and arrives at place B:
\end_layout

\begin_layout Itemize
A journey will be created with a start point of A and an end point of B
\end_layout

\begin_layout Itemize
The journey will consist of two journey steps:
\end_layout

\begin_deeper
\begin_layout Itemize
Step one will have an activity of CLASSIFIED/WALKING with five repetitions
\end_layout

\begin_layout Itemize
Step two will have an activity of CLASSIFIED/VEHICLE/BUS with ten repetitions
\end_layout

\end_deeper
\begin_layout Standard
When the user is on a journey, the Context Analyser compares their current
 history to that of previously recorded journeys leaving the same place.
 If any of the journeys match, their destinations are considered as 
\series bold
predictions
\series default
.
 The number of times each matching journey occurred is summed and the result
 is used as a 'score' for the destination involved.
 The destination with the highest score is considered the most likely destinatio
n for the user.
\end_layout

\begin_layout Standard
For the purposes of prediction, a partial journey is considered to match
 a historical journey if:
\end_layout

\begin_layout Itemize
it contains the same number of, or fewer, steps
\end_layout

\begin_layout Itemize
each step has the same activity
\end_layout

\begin_layout Itemize
the number of repetitions in each completed step (not the last step) is:
\end_layout

\begin_deeper
\begin_layout Itemize
no less than 50% of the historical value
\end_layout

\begin_layout Itemize
no greater than 150% of the historical value
\end_layout

\end_deeper
\begin_layout Itemize
the number of repetitions of the last step is:
\end_layout

\begin_deeper
\begin_layout Itemize
no greater than 150% of the historical value
\end_layout

\end_deeper
\begin_layout Subsection
Broadcast intents
\end_layout

\begin_layout Standard
The 
\noun on
Context Analyser
\noun default
 broadcasts three different intents to make other applications aware of
 certain events.
 Applications require the RECEIVE_UPDATES permission to receive these broadcasts
, as discussed previously.
 These intents are:
\end_layout

\begin_layout Itemize
uk.co.md87.android.contextanalyser.ACTIVITY_CHANGED
\end_layout

\begin_layout Itemize
uk.co.md87.android.contextanalyser.CONTEXT_CHANGED
\end_layout

\begin_layout Itemize
uk.co.md87.android.contextanalyser.PREDICTION_AVAILABLE
\end_layout

\begin_layout Standard
The 
\series bold
ACTIVITY_CHANGED
\series default
 intent is broadcast whenever the user's activity is discovered to have
 changed.
 It contains two string extras - the old activity and the new activity -
 under the keys 
\begin_inset Quotes eld
\end_inset

old
\begin_inset Quotes erd
\end_inset

 and 
\begin_inset Quotes eld
\end_inset

new
\begin_inset Quotes erd
\end_inset

 respectively.
\end_layout

\begin_layout Standard
The 
\series bold
CONTEXT_CHANGED
\series default
 intent occurs whenever some other aspect of the user's context changes.
 Presently this only includes the user's current place.
 It contains an integer extra under the key 
\begin_inset Quotes eld
\end_inset

type
\begin_inset Quotes erd
\end_inset

 which describes which type of context has changed; this will have the value
 1 for place updates.
 Place updates will also have two further integer extras - the place the
 user was previously in (or -1 if they were not in a known place) and the
 place the user is now in - under the keys 
\begin_inset Quotes eld
\end_inset

old
\begin_inset Quotes erd
\end_inset

 and 
\begin_inset Quotes eld
\end_inset

new
\begin_inset Quotes erd
\end_inset

, respectively.
 These place IDs can be resolved to names and latitude/longitude by querying
 the relevant content provider, described below.
\end_layout

\begin_layout Standard
The 
\series bold
PREDICTION_AVAILABLE
\series default
 intent is broadcast whenever a prediction has been made by the 
\noun on
Context Analyser
\noun default
.
 The best available prediction is included as a place ID in the 
\begin_inset Quotes eld
\end_inset

best_target
\begin_inset Quotes erd
\end_inset

 key, the total score for the prediction to that place is available as an
 integer in the 
\begin_inset Quotes eld
\end_inset

count
\begin_inset Quotes erd
\end_inset

 key, and the 'probability' (the score for that place divided by the total
 scores for all predicted places) is a float in the 
\begin_inset Quotes eld
\end_inset

best_probability
\begin_inset Quotes erd
\end_inset

 key.
 A full set of predictions can be retrieved from the relevant content provider,
 described below.
\end_layout

\begin_layout Standard
As discussed in the permissions section (
\begin_inset CommandInset ref
LatexCommand prettyref
reference "sub:Permissions"

\end_inset

), you may wish to make sure that all broadcasts you receive are sent by
 an application which holds the BROADCAST permission.
 This ensures that the user trusts the application to send these broadcasts,
 and reduces the chance that they are from a malicious application attempting
 to introduce erroneous data or otherwise compromise your receiver.
\end_layout

\begin_layout Subsection
Content providers
\end_layout

\begin_layout Standard
The 
\noun on
Context Analyser
\noun default
 provides four content providers from which you can receive data:
\end_layout

\begin_layout Subsubsection
Activities
\end_layout

\begin_layout Standard
Allows querying of the user's current activity.
 This may be expanded in future versions to allow querying of all known
 activities.
 Read only, does not accept selection, projection or order parameters.
\end_layout

\begin_layout Standard
URI: 
\noun on
content://uk.co.md87.android.contextanalyser.activitiescontentprovider/current
\end_layout

\begin_layout Standard
Content type: 
\noun on
vnd.contextanalyser.activity
\end_layout

\begin_layout Standard
Columns:
\end_layout

\begin_layout Standard
\begin_inset Tabular
<lyxtabular version="3" rows="2" columns="3">
<features>
<column alignment="center" valignment="top" width="0">
<column alignment="center" valignment="top" width="0">
<column alignment="center" valignment="top" width="0">
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\series bold
Name
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\series bold
Type
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\series bold
Remarks
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
activity
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
string
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
The user's current activity
\end_layout

\end_inset
</cell>
</row>
</lyxtabular>

\end_inset


\end_layout

\begin_layout Subsubsection
Journeys
\end_layout

\begin_layout Standard
Allows querying of the user's historical journeys and steps within them.
 Read/write access, supports selection and ordering.
\end_layout

\begin_layout Paragraph
Journeys
\end_layout

\begin_layout Standard
URI: 
\noun on
content://uk.co.md87.android.contextanalyser.journeyscontentprovider/journeys
\end_layout

\begin_layout Standard
Content type: 
\noun on
vnd.contextanalyser.journey
\end_layout

\begin_layout Standard
Columns:
\end_layout

\begin_layout Standard
\begin_inset Tabular
<lyxtabular version="3" rows="6" columns="3">
<features>
<column alignment="center" valignment="top" width="0">
<column alignment="center" valignment="top" width="0">
<column alignment="center" valignment="top" width="0">
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\series bold
Name
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\series bold
Type
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\series bold
Remarks
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
_id
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
long
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
A unique, persistent ID for the journey
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
start
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
long
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
The ID of the place at which this journey starts
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
end
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
long
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
The ID of the place at which this journey ends
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
steps
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
int
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
The number of steps in this journey
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
number
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
int
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
The number of times this journey has been made
\end_layout

\end_inset
</cell>
</row>
</lyxtabular>

\end_inset


\end_layout

\begin_layout Paragraph
Journey steps
\end_layout

\begin_layout Standard
URI: 
\noun on
content://uk.co.md87.android.contextanalyser.journeyscontentprovider/steps
\end_layout

\begin_layout Standard
Content type: 
\noun on
vnd.contextanalyser.journeystep
\end_layout

\begin_layout Standard
Columns:
\end_layout

\begin_layout Standard
\begin_inset Tabular
<lyxtabular version="3" rows="6" columns="3">
<features>
<column alignment="center" valignment="top" width="0">
<column alignment="center" valignment="top" width="0">
<column alignment="center" valignment="top" width="0">
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\series bold
Name
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\series bold
Type
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\series bold
Remarks
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
_id
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
long
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
A unique, persistent ID for the step
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
activity
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
string
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
The activity that was observed
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
repetitions
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
int
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
The number of times the activity occurred
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
journey
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
long
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
The ID of the journey that this step belongs to
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
next
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
long
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
The ID of the next step in the journey, or 0 if the last step in sequence
\end_layout

\end_inset
</cell>
</row>
</lyxtabular>

\end_inset


\end_layout

\begin_layout Subsubsection
Places
\end_layout

\begin_layout Standard
Allows querying of the user's know places.
 Read/write access, supports selection and ordering.
\end_layout

\begin_layout Standard
URI: 
\noun on
content://uk.co.md87.android.contextanalyser.placescontentprovider/places
\end_layout

\begin_layout Standard
Content type: 
\noun on
vnd.contextanalyser.location
\end_layout

\begin_layout Standard
Columns:
\end_layout

\begin_layout Standard
\begin_inset Tabular
<lyxtabular version="3" rows="8" columns="3">
<features>
<column alignment="center" valignment="top" width="0">
<column alignment="center" valignment="top" width="0">
<column alignment="center" valignment="top" width="0">
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\series bold
Name
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\series bold
Type
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\series bold
Remarks
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
_id
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
long
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
A unique, persistent ID for the place
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
name
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
string
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
The name of the place
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
latitude
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
double
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
The latitude of the centre of the place
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
longitude
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
double
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
The longitude at the centre of the place
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
duration
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
long
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
Amount of time in seconds spent at the place
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
times
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
long
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
The number of times the place has been visited
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
lastvisit
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
long
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
The unix timestamp of the last visit (seconds)
\end_layout

\end_inset
</cell>
</row>
</lyxtabular>

\end_inset


\end_layout

\begin_layout Subsubsection
Predictions
\end_layout

\begin_layout Standard
Allows querying of the current predictions, if any.
 Read only, does not accept selection, projection or order parameters.
\end_layout

\begin_layout Standard
URI: 
\noun on
content://uk.co.md87.android.contextanalyser.predictionscontentprovider/predictions
\end_layout

\begin_layout Standard
Content type: 
\noun on
vnd.contextanalyser.prediction
\end_layout

\begin_layout Standard
Columns:
\end_layout

\begin_layout Standard
\begin_inset Tabular
<lyxtabular version="3" rows="4" columns="3">
<features>
<column alignment="center" valignment="top" width="0">
<column alignment="center" valignment="top" width="0">
<column alignment="center" valignment="top" width="0">
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\series bold
Name
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\series bold
Type
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\series bold
Remarks
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
_ID
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
long
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
A unique ID for the prediction
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
place
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
long
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
The ID of the predicted destination
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
count
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
int
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
The 'score' of the prediction
\end_layout

\end_inset
</cell>
</row>
</lyxtabular>

\end_inset


\end_layout

\begin_layout Subsection
Context API
\end_layout

\begin_layout Standard
A small 
\begin_inset Quotes eld
\end_inset

API
\begin_inset Quotes erd
\end_inset

 is available to facilitate easier access to the services exposed by the
 
\noun on
Context Analyser.

\noun default
 This consists of the 
\noun on
ContextApi
\noun default
 class and its assorted subclasses.
 These subclasses contain constant values for all column names, URIs and
 content types, as well as intent names and enumeration values.
\end_layout

\begin_layout Standard
The 
\noun on
ContextApi.Intents
\noun default
 class defines string constants for the three broadcast intents which are
 used by the 
\noun on
Context Analyser
\noun default
.
 The 
\noun on
ContextTypes
\noun default
 inner class contains integer constants for the possible 'type' values for
 the CONTEXT_CHANGED intent.
\end_layout

\begin_layout Standard
The 
\noun on
Places
\noun default
, 
\noun on
Journeys
\noun default
, 
\noun on
JourneySteps
\noun default
, 
\noun on
Predictions 
\noun default
and 
\noun on
Activities
\noun default
 classes all contain a CONTENT_URI field containing the Uri of the the content
 provider, a CONTENT_TYPE field containing the string mime type for that
 provider, and a static 
\noun on
ColumnNames
\noun default
 class which contains string constants for each column returned by the content
 provider.
\end_layout

\begin_layout Standard
The following code from the 
\noun on
Places
\noun default
 application shows the use of these constant values:
\end_layout

\begin_layout LyX-Code
final Cursor cursor = managedQuery(ContextApi.Places.CONTENT_URI,
\end_layout

\begin_layout LyX-Code
         new String[] { ColumnNames.LATITUDE, ColumnNames.LONGITUDE,     
                 
\end_layout

\begin_layout LyX-Code
         ColumnNames._ID, ColumnNames.NAME, ColumnNames.LAST_VISIT,       
           
\end_layout

\begin_layout LyX-Code
         ColumnNames.VISIT_COUNT }, null, null, null);
\end_layout

\begin_layout LyX-Code

\end_layout

\begin_layout LyX-Code
if (cursor.moveToFirst()) { 
\end_layout

\begin_layout LyX-Code
    final int nameColumn = cursor.getColumnIndex(ColumnNames.NAME);
\end_layout

\begin_layout LyX-Code
    final int idColumn = cursor.getColumnIndex(ColumnNames._ID);
\end_layout

\begin_layout LyX-Code

\end_layout

\begin_layout LyX-Code
    do {
\end_layout

\begin_layout LyX-Code
        final String name = cursor.getString(nameColumn);
\end_layout

\begin_layout LyX-Code
        final int id = cursor.getInt(idColumn);
\end_layout

\begin_layout LyX-Code
        // etc
\end_layout

\begin_layout LyX-Code
    } while (cursor.moveToNext());
\end_layout

\begin_layout LyX-Code
}
\end_layout

\begin_layout Standard
Note that the code imports both the 
\noun on
ContextApi
\noun default
 class, and the 
\noun on
ContextApi.Places.ColumnNames
\noun default
 class.
\end_layout

\begin_layout Standard
\begin_inset Newpage pagebreak
\end_inset


\end_layout

\begin_layout Section
Extract from export of window data
\begin_inset CommandInset label
LatexCommand label
name "sec:Extract-from-export"

\end_inset


\end_layout

\begin_layout Quote
\noindent
\align left

\size footnotesize
Activity: CLASSIFIED/WALKING
\end_layout

\begin_layout Quote
\noindent
\align left

\size footnotesize
1264518159452:-7.804459,-1.3620348,-0.55843425,99.4375,73.3125,-32.6875, 1264518159502
:-8.853226,-0.53119355,-0.0,100.4375,72.0625,-33.6875, 1264518159557:-11.699879,0.830841
2,-1.2803127,101.1875,70.8125,-32.9375, 1264518159601:-13.797412,-0.24516626,-1.1168685
,101.4375,70.5625,-31.9375, 1264518159652:-10.59663,-4.8760843,1.96133,102.375,71.5625,-
31.1875, 1264518159702:-10.528529,-5.3119354,0.6946377,102.125,71.5625,-29.6875,
 1264518159751:-14.219643,-2.506144,2.4108016,102.375,69.5625,-28.0, 1264518159801:-9.2
75456,-1.2666923,1.253072,102.875,69.8125,-29.0, 1264518159852:-5.1621118,-0.7491191,0.2
7240697,103.125,69.8125,-30.6875, 1264518159901:-3.568531,-0.8036005,0.88532263,103.625
,68.5625,-31.9375, 1264518159951:-4.4810944,-0.51757324,1.253072,103.625,69.0625,-31.687
5, 1264518160001:-6.9191365,1.4028958,1.0487667,103.875,70.5625,-30.4375, 126451816006
1:-13.007432,1.3484144,0.32688835,105.0625,70.5625,-29.0, 1264518160102:-16.42614,1.2394
516,-0.10896278,104.375,71.3125,-27.25, 1264518160152:-15.908566,-2.3018389,-0.06810174
,104.625,71.0625,-27.25, 1264518160202:-9.915613,-4.780742,1.6344417,105.3125,71.0625,-2
9.0, 1264518160251:-10.242501,-2.465283,2.73769,105.0625,70.3125,-30.4375, 126451816030
1:-10.351464,-4.8897047,0.58567494,104.375,71.3125,-32.6875, 1264518160351:-7.600154,-2.
0294318,0.81722087,102.375,73.0625,-33.6875, 1264518160401:-6.1291566,-1.0760075,0.7218
784,101.1875,72.3125,-34.375, 1264518160451:-5.3936577,-1.5527196,0.3677494,101.1875,71.
8125,-35.625, 1264518160502:-6.101916,-1.3892754,-0.23154591,100.6875,72.0625,-35.625,
 1264518160551:-7.2187843,-1.525479,-0.8308412,100.9375,68.0625,-36.625, 1264518160694
:-15.227549,-2.2609777,0.6401563,101.4375,68.0625,-36.625, 1264518160697:-15.227549,-2.2
609777,0.6401563,101.4375,68.0625,-36.625, 1264518160701:-15.227549,-2.2609777,0.640156
3,101.4375,68.0625,-36.625, 1264518160752:-9.956474,-3.840938,3.405087,103.125,68.8125,-
36.375, 1264518160802:-12.598822,-5.298315,0.32688835,103.875,69.3125,-34.875,
 1264518160858:-13.756551,-2.9283748,2.5333846,105.0625,69.3125,-32.6875, 126451816090
1:-8.962189,-1.6344417,0.9942854,105.5625,68.0625,-34.125, 1264518160951:-4.399372,-1.47
09976,0.54481393,104.625,68.8125,-35.875, 1264518161001:-3.050958,-1.4573772,0.58567494
,105.0625,68.5625,-35.875, 1264518161051:-4.5491962,0.19068487,0.6537767,105.0625,67.812
5,-35.375, 1264518161101:-6.7965536,1.3484144,0.87170225,105.5625,69.3125,-33.4375,
 1264518161151:-12.993812,1.920469,1.253072,107.3125,70.3125,-30.4375, 1264518161201:-
16.303556,0.53119355,0.14982383,106.8125,71.0625,-29.5, 1264518161251:-14.09706,-4.75350
14,0.20430522,105.5625,71.0625,-29.0, 1264518161301:-10.746454,-4.971427,1.4709976,105.5
625,70.3125,-30.1875, 1264518161351:-11.34575,-4.0588636,1.525479,104.125,70.5625,-32.93
75, 1264518161401:-8.989429,-4.930566,0.88532263,103.375,70.8125,-35.125, 126451816145
1:-6.4560447,-2.1111538,0.47671217,101.625,71.3125,-35.125, 
\end_layout

\begin_layout Standard
\begin_inset Newpage pagebreak
\end_inset


\end_layout

\begin_layout Section
Extract from ARFF representation
\begin_inset CommandInset label
LatexCommand label
name "sec:Extract-from-ARFF"

\end_inset


\end_layout

\begin_layout Quotation

\size footnotesize
@RELATION activity
\end_layout

\begin_layout Quotation

\size footnotesize
@ATTRIBUTE "Absolute Mean (series 0)" numeric
\end_layout

\begin_layout Quotation

\size footnotesize
@ATTRIBUTE "Absolute Mean (series 1)" numeric
\end_layout

\begin_layout Quotation

\size footnotesize
@ATTRIBUTE "Absolute Mean (series 2)" numeric
\end_layout

\begin_layout Quotation

\size footnotesize
@ATTRIBUTE "Absolute Mean (series 3)" numeric
\end_layout

\begin_layout Quotation

\size footnotesize
@ATTRIBUTE "Absolute Mean (series 4)" numeric
\end_layout

\begin_layout Quotation

\size footnotesize
@ATTRIBUTE "Absolute Mean (series 5)" numeric
\end_layout

\begin_layout Quotation

\size footnotesize
@ATTRIBUTE "Maximum (series 0)" numeric
\end_layout

\begin_layout Quotation

\size footnotesize
@ATTRIBUTE "Maximum (series 1)" numeric
\end_layout

\begin_layout Quotation

\size footnotesize
@ATTRIBUTE "Maximum (series 2)" numeric
\end_layout

\begin_layout Quotation

\size footnotesize
@ATTRIBUTE "Maximum (series 3)" numeric
\end_layout

\begin_layout Quotation

\size footnotesize
@ATTRIBUTE "Maximum (series 4)" numeric
\end_layout

\begin_layout Quotation

\size footnotesize
@ATTRIBUTE "Maximum (series 5)" numeric
\end_layout

\begin_layout Quotation

\size footnotesize
@ATTRIBUTE "Mean (series 0)" numeric
\end_layout

\begin_layout Quotation

\size footnotesize
@ATTRIBUTE "Mean (series 1)" numeric
\end_layout

\begin_layout Quotation

\size footnotesize
@ATTRIBUTE "Mean (series 2)" numeric
\end_layout

\begin_layout Quotation

\size footnotesize
@ATTRIBUTE "Mean (series 3)" numeric
\end_layout

\begin_layout Quotation

\size footnotesize
@ATTRIBUTE "Mean (series 4)" numeric
\end_layout

\begin_layout Quotation

\size footnotesize
@ATTRIBUTE "Mean (series 5)" numeric
\end_layout

\begin_layout Quotation

\size footnotesize
@ATTRIBUTE "Median (series 0)" numeric
\end_layout

\begin_layout Quotation

\size footnotesize
@ATTRIBUTE "Median (series 1)" numeric
\end_layout

\begin_layout Quotation

\size footnotesize
@ATTRIBUTE "Median (series 2)" numeric
\end_layout

\begin_layout Quotation

\size footnotesize
@ATTRIBUTE "Median (series 3)" numeric
\end_layout

\begin_layout Quotation

\size footnotesize
@ATTRIBUTE "Median (series 4)" numeric
\end_layout

\begin_layout Quotation

\size footnotesize
@ATTRIBUTE "Median (series 5)" numeric
\end_layout

\begin_layout Quotation

\size footnotesize
@ATTRIBUTE "Minimum (series 0)" numeric
\end_layout

\begin_layout Quotation

\size footnotesize
@ATTRIBUTE "Minimum (series 1)" numeric
\end_layout

\begin_layout Quotation

\size footnotesize
@ATTRIBUTE "Minimum (series 2)" numeric
\end_layout

\begin_layout Quotation

\size footnotesize
@ATTRIBUTE "Minimum (series 3)" numeric
\end_layout

\begin_layout Quotation

\size footnotesize
@ATTRIBUTE "Minimum (series 4)" numeric
\end_layout

\begin_layout Quotation

\size footnotesize
@ATTRIBUTE "Minimum (series 5)" numeric
\end_layout

\begin_layout Quotation

\size footnotesize
@ATTRIBUTE "Range (series 0)" numeric
\end_layout

\begin_layout Quotation

\size footnotesize
@ATTRIBUTE "Range (series 1)" numeric
\end_layout

\begin_layout Quotation

\size footnotesize
@ATTRIBUTE "Range (series 2)" numeric
\end_layout

\begin_layout Quotation

\size footnotesize
@ATTRIBUTE "Range (series 3)" numeric
\end_layout

\begin_layout Quotation

\size footnotesize
@ATTRIBUTE "Range (series 4)" numeric
\end_layout

\begin_layout Quotation

\size footnotesize
@ATTRIBUTE "Range (series 5)" numeric
\end_layout

\begin_layout Quotation

\size footnotesize
@ATTRIBUTE classification {CLASSIFIED/VEHICLE/CAR, CLASSIFIED/IDLE/STANDING,
 CLASSIFIED/VEHICLE/BUS, CLASSIFIED/WALKING, CLASSIFIED/IDLE/SITTING, CLASSIFIED
/WALKING/STAIRS/DOWN, CLASSIFIED/DANCING, CLASSIFIED/WALKING/STAIRS/UP}
\end_layout

\begin_layout Quotation

\size footnotesize
@DATA
\end_layout

\begin_layout Quotation

\size footnotesize
0.44361898, 4.7165775, 8.409821, 10.608887, 10.081055, 16.005371, 5.5162406, 9.479762,
 11.35937, 15.125, 1.4E-45, 1.4E-45, -0.44361898, 4.7165775, 8.409821, 10.608887,
 -10.081055, -16.005371, -0.19068487, 4.9169455, 8.7034025, 10.9375, -9.875, -15.6875,
 -3.8273177, 1.4437568, 3.4187074, -0.0625, -18.6875, -23.0625, 9.343558, 8.036005,
 7.940663, 15.1875, 18.6875, 23.0625, CLASSIFIED/VEHICLE/CAR
\end_layout

\begin_layout Quotation

\size footnotesize
3.9024422, 2.722155, 8.665946, 12.640137, 3.3691406, 15.688477, 1.4E-45, 4.6036777,
 15.649779, 15.125, 1.4E-45, 1.4E-45, -3.9024422, 2.722155, 8.665946, 12.640137,
 -3.3691406, -15.688477, -3.840938, 2.7240696, 8.499097, 12.6875, -3.375, -15.6875,
 -7.518432, 1.0351465, 4.69902, 8.75,-5.875, -17.625, 7.518432, 3.5685313, 10.95076,
 6.375, 5.875, 17.625, CLASSIFIED/VEHICLE/CAR
\end_layout

\begin_layout Quotation

\size footnotesize
2.9535933, 1.9287692, 9.193417, 8.516602, 3.9960938, 16.75, 1.4E-45, 3.173541, 14.669114,
 11.1875, 1.4E-45, 1.4E-45, -2.9535933, 1.9287692, 9.193417, 8.516602, -3.9960938,
 -16.75, -2.901134, 2.083913, 9.275456, 8.5, -3.875, -16.875, -5.0803895, 0.50395286,
 4.6445384, 5.5625, -6.625, -18.875, 5.0803895, 2.669588, 10.024576, 5.625, 6.625,
 18.875, CLASSIFIED/VEHICLE/CAR
\end_layout

\begin_layout Quotation

\size footnotesize
3.7644293, 0.39350045, 9.493064, 4.345215, 4.4628906, 17.933105, 1.4E-45, 2.002191,
 15.704261, 10.75, 1.4E-45, 1.4E-45, -3.7644293, 0.39350045, 9.493064, 4.345215,
 -4.4628906, -17.933105, -3.5957718, 0.50395286, 9.493382, 4.8125, -4.375, -17.875,
 -8.567199, -1.3756552, 6.006573, -2.0, -7.125, -20.5625, 8.567199, 3.3778462, 9.697687,
 12.75, 7.125, 20.5625, CLASSIFIED/VEHICLE/CAR 
\end_layout

\begin_layout Quotation

\size footnotesize
1.8751402, 2.4263377, 9.45008, 0.78222656, 5.080078, 16.560059, 1.4E-45, 3.8954194,
 9.874752, 2.625, 1.4E-45, 1.4E-45, -1.8751402, 2.4263377, 9.45008, 0.78222656,
 -5.080078, -16.560059, -1.8387469, 2.587866, 9.425281, 0.9375, -5.125, -16.625,
 -2.4789033, 1.334794, 9.220976, -1.3125, -6.625, -17.875, 2.4789033, 2.5606253,
 0.65377617, 3.9375, 6.625, 17.875, CLASSIFIED/VEHICLE/CAR
\end_layout

\begin_layout Quotation

\size footnotesize
1.7938437, 2.6545851, 9.423793, 0.110839844, 4.611328, 16.045898, 1.4E-45, 4.099725,
 9.697687, 1.625, 1.4E-45, 1.4E-45, -1.7938437, 2.6545851, 9.423793, 0.110839844,
 -4.611328, -16.045898, -1.8115063, 2.7240696, 9.41166, 0.1875, -4.625, -16.125,
 -2.5333846, 1.4437568, 9.248216, -1.0625, -5.625, -17.375, 2.5333846, 2.655968,
 0.44947147, 2.6875, 5.625, 17.375, CLASSIFIED/VEHICLE/CAR 
\end_layout

\begin_layout Standard
\begin_inset Newpage pagebreak
\end_inset


\end_layout

\begin_layout Section
User-annotated 
\noun on
Sensor Logger
\noun default
 Results
\begin_inset CommandInset label
LatexCommand label
name "sec:User-annotated-Sensor-Logger"

\end_inset


\end_layout

\begin_layout Standard
\begin_inset Tabular
<lyxtabular version="3" rows="83" columns="3">
<features islongtable="true">
<column alignment="right" valignment="top" width="0">
<column alignment="left" valignment="top" width="0">
<column alignment="left" valignment="top" width="0">
<row endhead="true" endfirsthead="true">
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\series bold
Count
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\series bold
User annotation
\end_layout

\end_inset
</cell>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\series bold
On-device classification
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
3
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
CLASSIFIED/DANCING
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
6
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
CLASSIFIED/IDLE/SITTING
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
2
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
CLASSIFIED/IDLE/STANDING
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
9
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
CLASSIFIED/UNKNOWN
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
31
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
CLASSIFIED/VEHICLE/BUS
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
11
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout

\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
CLASSIFIED/VEHICLE/CAR
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
1
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
10
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
CLASSIFIED/IDLE/SITTING
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
1
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
beed
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
CLASSIFIED/VEHICLE/BUS
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
1
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
breathing
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
CLASSIFIED/VEHICLE/BUS
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
1
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
cycle
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
CLASSIFIED/VEHICLE/BUS
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
1
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
Dancing
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
CLASSIFIED/WALKING
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
1
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
driving
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
CLASSIFIED/WALKING/STAIRS/DOWN
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
1
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
drunkenly going to the bathroom to pee.
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
CLASSIFIED/VEHICLE/CAR
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
1
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
fixing my clothes
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
CLASSIFIED/VEHICLE/BUS
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
1
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
hhhg
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
CLASSIFIED/VEHICLE/BUS
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
2
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
In a car
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
CLASSIFIED/VEHICLE/BUS
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
1
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
in a house
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
CLASSIFIED/VEHICLE/CAR
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
4
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
in bed
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
CLASSIFIED/VEHICLE/BUS
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
2
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
it is a cat
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
CLASSIFIED/VEHICLE/BUS
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
1
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
kitchen work
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
CLASSIFIED/IDLE/STANDING
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
1
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
laundry
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
CLASSIFIED/VEHICLE/CAR
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
1
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
lay in bed
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
CLASSIFIED/VEHICLE/BUS
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
1
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
layin down
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
CLASSIFIED/IDLE/STANDING
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
1
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
layin in bed
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
CLASSIFIED/VEHICLE/BUS
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
3
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
laying down
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
CLASSIFIED/VEHICLE/BUS
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
1
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
laying down
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
CLASSIFIED/VEHICLE/CAR
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
1
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
laying down in bed
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
CLASSIFIED/VEHICLE/BUS
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
3
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
laying in bed
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
 CLASSIFIED/VEHICLE/BUS
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
1
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
laying in bed with the phone on my stomach
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
CLASSIFIED/VEHICLE/CAR
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
1
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
lie in bed
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
CLASSIFIED/VEHICLE/BUS
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
1
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
ligger pa golvet
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
CLASSIFIED/VEHICLE/BUS
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
1
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
love
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
CLASSIFIED/VEHICLE/CAR
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
1
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
lying in bed
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
CLASSIFIED/VEHICLE/BUS
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
1
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
moving phone
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
CLASSIFIED/WALKING
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
1
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
Nothing at all!
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
CLASSIFIED/UNKNOWN
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
1
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
passenger in car straight road 50mph
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
CLASSIFIED/VEHICLE/BUS
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
1
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
playin gamw
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
CLASSIFIED/VEHICLE/BUS
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
1
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
pooping
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
CLASSIFIED/UNKNOWN
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
1
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
Rolling around
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
CLASSIFIED/WALKING
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
1
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
Rotating the phone
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
CLASSIFIED/WALKING/STAIRS/UP
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
1
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
seating down
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
CLASSIFIED/VEHICLE/BUS
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
1
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
seting
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
CLASSIFIED/VEHICLE/BUS
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
1
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
shake the device
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
CLASSIFIED/VEHICLE/CAR
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
1
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
shaking my leg sitting on my bed
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
CLASSIFIED/VEHICLE/BUS
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
1
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
shaking phone violently!!!
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
CLASSIFIED/WALKING/STAIRS/UP
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
1
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
siq
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
CLASSIFIED/VEHICLE/BUS
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
1
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
sitti
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
CLASSIFIED/VEHICLE/BUS
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
1
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
Sitting
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
CLASSIFIED/IDLE/SITTING
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
1
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
Sitting
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
CLASSIFIED/IDLE/STANDING
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
19
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
Sitting
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
CLASSIFIED/VEHICLE/BUS
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
6
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
Sitting
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
CLASSIFIED/VEHICLE/CAR 
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
1
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
sitting at my desk
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
CLASSIFIED/VEHICLE/BUS
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
1
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
Sitting down
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
CLASSIFIED/VEHICLE/BUS
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
1
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
sitting on my ass
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
CLASSIFIED/VEHICLE/CAR
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
1
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
sitting on the couch
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
CLASSIFIED/VEHICLE/BUS
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
1
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
sjxjxgzog
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
CLASSIFIED/VEHICLE/BUS
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
1
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
sleep
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
CLASSIFIED/IDLE/SITTING
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
2
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
sleeping
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
CLASSIFIED/VEHICLE/BUS
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
1
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
Standing
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
CLASSIFIED/VEHICLE/BUS
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
1
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
Standing
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
CLASSIFIED/VEHICLE/CAR
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
1
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
swinging
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
CLASSIFIED/IDLE/SITTING
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
1
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
test
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
CLASSIFIED/VEHICLE/CAR
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
2
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
train
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
CLASSIFIED/VEHICLE/BUS
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
1
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
traveling by bus
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
CLASSIFIED/VEHICLE/CAR
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
1
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
traveling by car
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
CLASSIFIED/VEHICLE/BUS
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
1
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
travelling by bus
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
CLASSIFIED/VEHICLE/CAR
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
2
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
travelling by s line
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
CLASSIFIED/VEHICLE/BUS
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="right" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
3
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
UNCLASSIFIED/NOTCORRECTED
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
CLASSIFIED/DANCING
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
69
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
UNCLASSIFIED/NOTCORRECTED
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
CLASSIFIED/IDLE/SITTING
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
29
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
UNCLASSIFIED/NOTCORRECTED
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
CLASSIFIED/IDLE/STANDING
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
32
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
UNCLASSIFIED/NOTCORRECTED
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
CLASSIFIED/VEHICLE/BUS
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
14
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
UNCLASSIFIED/NOTCORRECTED
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
CLASSIFIED/VEHICLE/CAR
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
16
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
UNCLASSIFIED/NOTCORRECTED
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
CLASSIFIED/WALKING
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
5
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
Walking
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
CLASSIFIED/VEHICLE/BUS
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
1
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
Walking
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
CLASSIFIED/VEHICLE/CAR
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
1
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
Walking (downs tairs)
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
CLASSIFIED/WALKING/STAIRS/UP
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
1
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
walking in a store
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
CLASSIFIED/VEHICLE/CAR
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
1
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
walking in circles
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
CLASSIFIED/VEHICLE/CAR
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
1
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
watching amovie!
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
CLASSIFIED/VEHICLE/BUS
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
1
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
watching TV
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
CLASSIFIED/VEHICLE/BUS
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
1
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
work in the airport
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
CLASSIFIED/VEHICLE/CAR
\end_layout

\end_inset
</cell>
</row>
<row>
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
1
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
z
\end_layout

\end_inset
</cell>
<cell alignment="left" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\begin_layout Plain Layout
CLASSIFIED/VEHICLE/BUS
\end_layout

\end_inset
</cell>
</row>
</lyxtabular>

\end_inset


\end_layout

\begin_layout Standard
\begin_inset Float table
placement H
wide false
sideways false
status open

\begin_layout Plain Layout
\begin_inset Caption

\begin_layout Plain Layout
User-annotated 
\noun on
Sensor Logger
\noun default
 results
\begin_inset CommandInset label
LatexCommand label
name "tab:User-annotated-Sensor-Logger"

\end_inset


\end_layout

\end_inset


\end_layout

\end_inset


\end_layout

\begin_layout Standard
\begin_inset Newpage pagebreak
\end_inset


\begin_inset CommandInset bibtex
LatexCommand bibtex
bibfiles "/home/chris/Projects/Java/ContextApi/papers/project"
options "bibtotoc,savetrees"

\end_inset


\end_layout

\end_body
\end_document
