You are on page 1of 22

FINAL YEAR PROJECT INTERIM REPORT

An Android Application For Pothole Detection


Barry Kennedy Computer Systems 0655694
Supervisor: Joe Griffin

Contents
Project Summary ............................................................................... 4 Introduction ...................................................................................... 5 Project Background ........................................................................ 5 Overview......................................................................................... 5 Motivation ...................................................................................... 6 Objectives ....................................................................................... 6 Development Requirements ............................................................ 7 Other Resources ............................................................................. 7 Issues to be considered ................................................................... 8 Research ........................................................................................... 9 Android Development ..................................................................... 9 History ........................................................................................ 9 Architecture ................................................................................ 9 Application Framework .............................................................. 10 Existing applications .................................................................... 11 Pothole agent............................................................................. 11 Street bump .............................................................................. 12 Overall impressions ................................................................... 12 Photo driven applications .......................................................... 12 Accelerometer ............................................................................... 14 How it works ............................................................................. 14 Challenges ................................................................................ 14 Displaying the information ........................................................ 15 Network Location Provider ............................................................ 15 How it works ............................................................................. 15 Challenges ................................................................................ 16 Displaying the information ........................................................ 16 Current Progress ............................................................................. 17 Work Done to Date ....................................................................... 17 Issues and problems to date ......................................................... 17 Current work ................................................................................ 18 Project Plan ..................................................................................... 19 Work Breakdown Structure .......................................................... 19 Project Plan .................................................................................. 21 Bibliography .................................................................................... 22

Project Summary
My Final Year Project is a Smart Phone Application on the android platform that will; o Detect potholes on the roads while the user is driving o Report the location to Local Authorities for maintenance. When the user starts their journey, they launch the application on their phone and set it to record. The application launches the accelerometer and GPS monitors in the phone. The application monitors for changes in acceleration. When such a change is recorded, the application calls the GPS monitor and asks for the coordinates of the pothole. The application then adds the time, the geographic coordinates and the severity of the pothole to the event log. When the user finishes their journey they press stop and are presented with the event log. They can then choose which events to report to the local authorities. When finished the user clicks report and the data is sent to a database. The benefit of this project is that it provides Local Authorities with the location and the severity of potholes, which they can repair and ultimately will result in safer and a more enjoyable driving experience.

Introduction
Project Background
Potholes are cracks and cavities on roads caused by freezing. Over long periods of time Roads weaken under the weight of heavy vehicles. This causes small cracks to form. Water from rain or melted snow or ice gets into the cracks and freeze. This causes the cracks to expand. Continued pressure on the cracks lead to potholes.1 As Ireland continues to suffer from worsening weather conditions each year2, the issue of potholes is still an important issue. However Local Authorities are falling behind in repairing damage to the roads. According to the website Potholes.ie, there were 835 reported potholes in 2010 (up to the 20th of December) with only 149 logged as fixed.
3

Potholes.ie is one of several websites by members of the public to support public pothole reporting. However these websites require the user to remember exactly where the pothole was. Recent smart phone applications such as FixMyStreet encourage users to stop and take a photograph of the pothole (however this is not always an option). My project aims to create an Android Application that automatically records potholes and logs their exact location using GPS. This will hopefully significantly increase the numbers of potholes reported.

Overview
The application is based on the Androids built in Accelerometer. An Accelerometer is a device that measures acceleration relative to free fall. Any significant changes in the phones acceleration are logged by the SeniorEventListener. The event is then added to an event log.
1

Minnesota, S o 2010. Potholes page [Online]. Available from : http://www.dot.state.mn.us/information/potholes/videoimages.html [Accessed : 20, December, 2010]. 2 Thomas Crosbie Media Ltd 2010. November cold snap enters record books | BreakingNews.ie [Online]. Available from : http://www.breakingnews.ie/ireland/eyidmhsnqlcw/ [Accessed : 20, December, 2010] 3 Administrator, 2010. Potholes.ie | County League Table [Online]. Available from : http://www.potholes.ie/county-league-table.html [Accessed : 20, December, 2010].

The Android platform also has tools for identifying the locationincluding a Global Positioning System (GPS) receiver (this is discussed further in the research section). One of the issues I have identified is the difficulty of getting an accurate location while travelling at average driving speeds. One possible solution is to record the journey from start to finish by regularly calling the GPS coordinates. This allows the application to plot the route and compare the events time stamp with the route to calculate the location of the car at the time of the event. When the journey finished, the user presses the stop recording button and is presented with the event log. This lists the events that have been recorded in this session (identification, time, location and severity). By clicking on the location the user can see the event displayed on a map (using the Google Maps API). Each event also has a tick box (ticked by default). If the box is not ticked the event will be excluded from the data to be transmitted to the database.

Motivation
This project was suggested by my Supervisor, Joe Griffin. For me this is a challenging project as I have no prior experience of Android development. I chose the Android platform because it is one of the fastest growing mobile operating systems on the market and is an open source development. This project allows me to gain an understanding of how some of the built in frameworks can be utilised to develop application Furthermore this project will demonstrate how mobile applications can contribute to improve road worthiness, road safety and a better driving experience in Ireland.

Objectives
The objectives of this project are to create an Application

That can identify a change in acceleration unique to potholes (excludes speed bumps, cats eyes etc)

That can obtain the most accurate location data possible That is able to transmit data to an external destination That has a good user interface- easy to use, clear instructions

My personal objective is to gain valuable experience in Android Development

Development Requirements
This project will be developed on Eclipse using the Android Developer Toolkit. It will be developed in Android API Level 7 (for users of Android 2.1 and later). This makes it available to 76% of Android users4. I decided to use Eclipse because it is the Google approved development environment for Android Development5 and as such has the greatest level of online support. Android Applications are developed using the Java Framework6. Testing will be done on the Android Emulator and my phone a HTC Desire running Android 2.2

Other Resources
Android Developer Website- http://developer.android.com/ Sams Teach Yourself Android Application Development in 24 Hoursby Lauren Darcey, Shane Conder TutsPlus Android Tutorials - http://mobile.tutsplus.com/
4

Rubin, A 2010. Platform Versions | Android Developers [Online]. Available from : http://developer.android.com/resources/dashboard/platform-versions.html [Accessed : 23, November, 2010]. 5 Rubin, A 2010. ADT Plugin for Eclipse | Android Developers [Online]. Available from : http://developer.android.com/sdk/eclipse-adt.html [Accessed : 20, December, 2010]. 6 Rubin, A 2010. Application Fundamentals | Android Developers [Online]. Available from : http://developer.android.com/guide/topics/fundamentals.html [Accessed : 20, December, 2010].

Issues to be considered
One of the major difficulties will be differentiating between potholes and non potholes. For example a bump on the road might also be recorded if a driver goes over speed bumps, cats eyes or other objects lying on the road. Another difficulty will be getting the exact location of the event whilst the car is moving at speed. Battery drainage is one of the key issues. The Accelerometer and GPS will drain the battery over time, especially during an extended journey. For such journeys a car charger is recommended.

Research
To date, I have carried out extensive research into android development and how the accelerometer and geo-location services operate. I have also examined similar existing applications.

Android Development
History Android is a mobile phone operating system. It was originally developed by Android Inc, which was acquired by Google in July 2005.7 Today development is over seen by the Android Open Source Project (AOSP), led by Google. The AOSP is tasked with the maintenance and further development of Android.
8

As of the 3rd Quarter of 2010 Android has a market share of 25% making it the second most popular phone operating system of the market (second only to Nokias Symbian). This is a major rise from the 3.5% share Android had in 3Q2009.
9

Architecture Android is based on the Linux access Kernal. are all of Android able to the the Developers

componements

Application Framework used by core applications when creating an application.


Figure 1- Android Architecture (http://developer.android.com/images/system-architecture.jpg)

Elgin, B B 2010. [Online]. Available from : http://www.businessweek.com/technology/content/aug2005/tc20050817_0949_tc 024.htm [Accessed : 23, November, 2010]. 8 Rubin, A 2010. About the Android Open Source Project | Android Open Source [Online]. Available from : http://source.android.com/about/index.html [Accessed : 23, November, 2010]. 9 Gartner, I M 2010. Gartner Says Worldwide Mobile Phone Sales Grew 35 Percent in Third Quarter 2010; Smartphone Sales Increased 96 Percent [Online]. Available from : http://www.gartner.com/it/page.jsp?id=1466313 [Accessed : 23, November, 2010].
7

These

features

include

the

Location

Manager,

Bluetooth,

the

Accelerometer, and Email etc.10 Application Framework An Android Application has four parts- Activities, Services, Broadcast Receivers and Content Providers. Activities are the visual interfaces for each task in the application. Activities in my Application might include the graph for displaying the Accelerometers data, the map displaying the route and the list of events logged. Each activity, despite being linked, is independent class. Services are the background tasks that dont have a user interface. Services might be linked to one or more activities. In this application Services would include recording the route over the duration of the journey (this happens even when the map is not displayed) The Broadcast Receiver receives and reacts to broadcast

announcements (for example, a low battery message). In my Application the Broadcast Receiver is listening for changes in acceleration (i.e. potholes) The Content Provider shares the applications data with other applications. This data can be stored in a SQLite database.

10

Rubin, A 2010. What is Android? | Android Developers [Online]. Available from : http://developer.android.com/guide/basics/what-is-android.html [Accessed : 20, December, 2010].

Existing applications
As part of my initial research I decided to investigate applications that offer the same or similar services for android and other platforms. My aim is to see how these applications work and to see how they can be improved. To date I have identified two Android Apps that offer the same service - Pothole agent and street bump. I also looked at photo driven applications and pothole reporting websites. Pothole agent Pothole agent is an application made by the BITS Android Team and is free to download from the android market. It works by recognising the acceleration over time (displayed on the graph). When you start the app you are presented with the graph and two event
Figure 2 Pothole Agent http://www.androidzoom.com/android_applications/tools /pothole-agent_isud.html

controllers (one which starts the accelerometer and one which starts the session). I would not recommend this as there was no explanation of what each button did or how to use the application. The user interface was poor and offers little instruction to the user. I was able to figure out most of the functionally by trial and error but I do not believe the average user would have the patience or technical knowledge to be able to do so. One of the flaws identified was that the GPS is not automatically turned on when launching the app. The user needs to go to the phones settings to turn it on. It is possible for applications to change the GPS setting on launching.

Street bump Street bump is relatively new application based upon the same concept. Like the user interface it is confusing. Instead of a graph the X, Y and Z fields are represented by circles with the size and colour changing depending on acceleration. However there is no explanation as to the meaning of the different colours. One positive feature is that there is a simple option called Start Recording. It also automatically starts the GPS function. This app has received criticism due for being battery heavy, so much so that users are advised to use car chargers while the app is in use. Overall impressions Neither of the applications I investigated were satisfactory from the perspective of the end user, Applications should be user friendly and easy to figure out. I intend to create an application that addresses these issues. Photo driven applications There are several applications (some developed by local authorities) that offer pothole reporting systems that require the user to take a photograph and upload it with the location data as opposed to a detection system. These can be used for a
Figure 3 Fix My Street www.androidzoom.com/android_applications/pro ductivity/fixmystreet_xpp.html

number of reports (potholes, graffiti, broken lights etc) Examples of these applications are Fix my Street (android), See Click Fix (iPhone) and Fill my Hole (iPhone). I tried to test Fix My Street but the reporting feature only works in the UK.

Users can take photographs and add a description and their contact details. In my opinion the user interface on Fix My Street is very simple to use. Websites In addition to phone applications, there are several websites that allow users to report potholes. Potholes.ie was founded by David Well (founder of www.ripoff.ie) following the big freeze of winter 2009/201011. Registered users can submit details of potholes (location and description). The website contains a map where you can see potholes (marked as reported pothole, reported uneven surface and Reported Fixed Issues) and a league table of both reported and fixed potholes by county. There are also details for contacting your council and making a claim. Other similar websites include and Pothole Watch That Watch Hole

(http://www.potholewatch.com) (http://www.watchthathole.com).

11

O Ftharta, C. (2010) 23% of cars damaged by potholes , The Irish Examiner, 10 May, Available from : http://www.examiner.ie/ireland/23-of-cars-damaged-by-potholes-119526.html [Accessed : 20, December, 2010].

Accelerometer
An accelerometer is an electromechanical device that measures acceleration. 12 An accelerometer is one of the many hardware features contained in some android phones. The Accelerometer has been used to create several interesting Android Applications. Examples of these include: G-Lock- locks/unlocks the key pad based on movement of the phone Newtons Cradle- demonstrates the physics of Newtons Cradle13 Raging Thunder- a car racing game

How it works The Accelerometer measures acceleration on 3 axes- X, Y and Z. The X axis is horizontal and points to the right, the Y axis is vertical and points up and the Z axis points towards the outside of the front face of the screen.14 Any sudden significant changes to one of the Axes should indicate that the car has hit a bump while driving15 Challenges The major challenge will be differentiating between the different types of bump a car can experience. For example, does a pothole display
Figure 4- XYZ axes (http://developer.android.com/image s/axis_device.png)

Engineering, D 2010. A beginner's guide to accelerometers [Online]. Available from : http://www.dimensionengineering.com/accelerometers.htm [Accessed : 18, December, 2010]. 13 accelerometer Android Freeware. Download free accelerometer apps for Android Phones. [Online]. Available from : http://www.androidfreeware.net/tag-accelerometer.html [Accessed : 20, December, 2010]. 14 Rubin, A 2010. SensorEvent | Android Developers [Online]. Available from : http://developer.android.com/reference/android/hardware/SensorEvent.html [Accessed : 20, December, 2010] 15 Raging Thunder Android Game Review by AndroidTapp.com | Android Tapp. Android App Reviews [Online]. Available from : http://www.androidtapp.com/raging-thunder/ [Accessed : 20, December, 2010].
12

different results to a speed bump? The other question is how much of a change needs to be registered for an event to be recorded. During January 2011, I intend to test out the accelerometers functions to figure how to record potholes. Displaying the information Of the two applications I have investigated, they both display data separately. Pothole agent uses a graph displaying the X, Y and Z axes while Street Bump displays the data as circles that expand as acceleration increases. I found the graph method to be preferable as it is easier for the end user to understand what is happening.

Network Location Provider


One of the better known features of android phones is the location and mapping services. The users location is used in many applications including Satellite Navigation (Google Maps Navigation), Location based Social Networking (e.g. Foursquare) and Augmented Reality browsers (e.g. Layer and Wikitude). The location is displayed

using Google Maps. How it works In order to retrieve an accurate location, Androids Network Location Provider is able to utilize the phones inbuilt Global Positioning System (GPS). GPS uses a network of 27 Earth Orbiting Satellites (24 active and 3 backups) developed by the US Military. The orbits are arranged so that
Figure 5 GPS Satellites in orbit http://www8.garmin.com/graphics/24s atellite.jpg

at anytime, anywhere on Earth, there are at least four satellites "visible" in the sky. The GPS receiver locates four or more of these

satellites. It then calculates the distance between itself and each satellite and compares the distances to triangulate its own location16. However despite the accuracy, GPS has some limitations: it only works outdoors it has a high battery consumption rate Its slower to return the location.

The alternatives to GPS use Cell tower and WiFi Signals to determine location. While they are not as accurate, they work indoors and outdoors, respond faster and require less battery power. Challenges The initial challenge is deciding which sources of information to use. As the Application is used while driving, using WiFi data is not an option. GPS would appear to be the most suitable for this Application. For this study accuracy is important in order to pinpoint the exact location of the pothole. Another key challenge is identifying user location in a moving vehicle, especially considering GPS slow return rate. One possible solution is to record the entire journey from start to finish. This involves calling the location at regular intervals to determine the route. When an event is recorded, the Application compares the events timestamp to the route to get the location of the event. Displaying the information The route and location of the Events can be displayed on a map using the Google Maps API which is available to android developers.

16

HowStuffWorks, I D 2010. HowStuffWorks "How GPS Receivers Work" [Online]. Available from : http://electronics.howstuffworks.com/gadgets/travel/gps.htm [Accessed : 18, December, 2010]

Current Progress
Work Done to Date
I started by researching Android development. This included what software to use and what programming language(s) to use. I have downloaded the following software Android SDK Eclipse (with Android Development Kit)

The Android Developer website has several tutorials and sample applications introducing the various aspects of Android Applications. These have helped me understand how Applications are structured. I also attended a talk by Marc McLoughlin of ULs Interactive Design Centre (IDC) about Android Development. I found this talk to be very informative and helpful. I have completed research into similar applications (both on Android and iPhone) and websites for pothole reporting. On the suggestion of Christiano Storni (One of the Faculty Members who graded my FYP Presentation) I contacted the Road Maintenance Departments of the three Local Authorities in the area (Limerick City, Limerick County and Clare County) with the aim of ascertaining what information they would like to receive from the application and in what format they would like to receive it. To date I have not received a reply.

Issues and problems to date


I encountered some difficulty installing the software on my FYP computer in the CSIS building. This has since been resolved with the assistance of two of my classmates who are also working on Android projects. While trying to resolve this problem I installed the software on my laptop.

Current work
My current work involves; o Setting out the different Activities and Services in the

application o Working on developing the applications user- interface o Working with the latest sample activity from the Android website which specifically deals with the various functions of the Accelerometer. Once these tasks are completed I will begin programming the Accelerometer activity for my application.

Project Plan
Work Breakdown Structure
1. Project Specification 1. Requirement Specification 2. MILESTONE: Project approved by Supervisor 2. Preliminary planning 1. Time estimation (Estimate of the project schedule) 2. Resource estimation (what resources are needed for the project i.e. software, books) 3. MILESTONE: Project plan in place 3. Research in Android Development 1. Initial Research (how android programmes are developed) 2. Practice Application (sample projects from text book) 3. MILESTONE: Ready to begin development 4. Initial Development 1. Paper Prototypes 2. Project set up 3. MILESTONE Project ready to be coded 5. Coding 1. Implement User Interface 2. Implement Accelerometer 3. Implement Location Service 4. MILESTONE: Coding finished 6. Testing 1. Debugging

2. User testing 3. MILESTONE: Testing complete 7. Website (optional/time dependant) 1. Database development 2. Front end development 3. MILESTONE: Website Finished 8. Project Report 1. Interim Report 1. Writing Report 2. Proof Report 3. Editing Report 2. Main Report 1. Writing Report 2. Proof Reading Report 3. Editing Report 4. Printing Report 3. MAJOR MILESTONE: Report complete 9. Project Finalisation 1. Review of initial specification 2. Uploading to Android Market 3. MAJOR MILESTONE: Project complete

Project Plan
My aim is to have the majority of work on the accelerometer and location finished by week 2 of the second semester. This should allow me sufficient time for testing and refinement of the application. If time permits I hope to put together a web based interface to display the information. In addition to the product development, I intend to regular document my work through a blog to assist with the Final Report.

Bibliography
Darcey, L & Conder, S 2010, Sams Teach Yourself Android Application Development in 24 Hours (Sams Teach Yourself -- Hours), Sams Rubin, A 2010. Android Developers [Online]. Available from : http://developer.android.com/index.html [Accessed : 21, December, 2010]. Potholes.ie [Online]. Available from : http://www.potholes.ie [Accessed : 20, December, 2010]. Rubin, A 2010. About the Android Open Source Project | Android Open Source [Online]. Available from: http://source.android.com/about/index.html [Accessed : 23, November, 2010]. McLoughlin, M 2010. Android Development (presentation) [Online]. Available from: http://www.idc.ul.ie/anu/MiLKlabs/AndroidDevelopment.pdf [Accessed : 21, December, 2010]. Minnesota, S o 2010. Potholes page [Online]. Available from : http://www.dot.state.mn.us/information/potholes/videoimages.html [Accessed : 20, December, 2010]. Thomas Crosbie Media Ltd 2010. November cold snap enters record books | BreakingNews.ie [Online]. Available from: http://www.breakingnews.ie/ireland/eyidmhsnqlcw/ [Accessed : 20, December, 2010] Elgin, B B 2010. [Online]. Available from : http://www.businessweek.com/technology/content/aug2005/tc2005 0817_0949_tc024.htm [Accessed : 23, November, 2010]. Gartner, I M 2010. Gartner Says Worldwide Mobile Phone Sales Grew 35 Percent in Third Quarter 2010; Smartphone Sales Increased 96 Percent [Online]. Available from : http://www.gartner.com/it/page.jsp?id=1466313 [Accessed : 23, November, 2010]. O Ftharta, C. (2010) 23% of cars damaged by potholes , The Irish Examiner, 10 May, Available from : http://www.examiner.ie/ireland/23-of-cars-damaged-by-potholes119526.html [Accessed : 20, December, 2010]. Engineering, D 2010. A beginner's guide to accelerometers [Online]. Available from : http://www.dimensionengineering.com/accelerometers.htm [Accessed : 18, December, 2010].

accelerometer Android Freeware. Download free accelerometer apps for Android Phones. [Online]. Available from : http://www.androidfreeware.net/tag-accelerometer.html [Accessed : 20, December, 2010]. Raging Thunder Android Game Review by AndroidTapp.com | Android Tapp. Android App Reviews [Online]. Available from : http://www.androidtapp.com/raging-thunder/ [Accessed : 20, December, 2010].