Full Final Report On Bus Tracking System
Full Final Report On Bus Tracking System
Full Final Report On Bus Tracking System
BELAGAVI, KARNATAKA
A Project Report on
“SMART BUS TRACKING SYSTEM”
Submitted in the partial fulfillment for the requirements for the conferment of Degree of
BACHELOR OF ENGINEERING
in
By
Miss. M MRUDULA USN: 1BY14IS027
Miss. SANGEETA JAIPRAKASH HEGDE USN: 1BY14IS045
Miss. GEETHA J USN: 1BY15IS402
Miss. LAKSHMI USN: 1BY15IS406
2017-2018
VISVESVARAYA TECHNOLOGICAL UNIVERSITY
BELAGAVI, KARNATAKA
CERTIFICATE
This is to certify that the Project work entitled “SMART BUS TRACKING SYSTEM” is a
bonafide work carried out by Miss. M MRUDULA (1BY14IS027), Miss. SANGEETA
JAIPRAKASH HEGDE (1BY14IS045), Miss. GEETHA J (1BY15IS402), Miss. LAKSHMI
(1BY15IS406), in partial fulfillment for the award of Bachelor of Engineering Degree in
Information Science and Engineering of the Visvesvaraya Technological University, Belagavi
during the year 2017-18. It is certified that all corrections/suggestions indicated for Internal
Assessment have been incorporated in this report. The project report has been approved as it
satisfies the academic requirements with respect to project work for the B.E Degree.
__________________ ______________________
Signature of the Guide Signature of the Coordinator
Mrs. S. Mahalakshmi Dr. Pushpa S. K
__________________ _____________________
Signature of the HOD Signature of the Principal
Dr. Manjunath T. N Dr. Mohan Babu G. N
EXTERNAL EXAMINERS
Name of the Examiners Signature with Date
1.
2.
ACKNOWLEDGEMENT
We are happy to present this project after completing it successfully. This project would not
have been possible without the guidance, assistance and suggestions of many individuals. We
would like to express our deep sense of gratitude and indebtedness to each and everyone who
has helped us make this project a success.
We heartily thank our Principal, Dr. Mohan Babu G. N, BMS Institute of Technology &
Management for his constant encouragement and inspiration in taking up this project.
We heartily thank our Project coordinator Dr. Pushpa S. K, Associate Professor, Dept. of
Information science and Engineering, for her constant follow up and advice throughout the
course of the Project work.
We gracefully thank our Project guide, Mrs. S. Mahalakshmi, Assistant Professor, Dept. of
Information Science and Engineering, for her encouragement and advice throughout the
course of the Project work.
Special thanks to all the staff members of Information Science Department for their help and
kind co-operation.
Lastly we thank our parents and friends for their encouragement and support given to us in
order to finish this precious work.
By,
Mrudula M
Sangeeta Jaiprakash Hegde
Geetha J
Lakshmi
i
BMS INSTITUTE OF TECHNOLOGY & MANAGEMENT
YELAHANKA, BANGALORE-64
DEPARTMENT OF INFORMATION SCIENCE AND ENGINEERING
Declaration
We, hereby declare that the project titled “SMART BUS TRACKING SYSTEM” is a record
of original project work undertaken for the award of the degree Bachelor of Engineering in
Information Science and Engineering of the Visvesvaraya Technological University, Belagavi
during the year 2017- 18. We have completed this project under the guidance of
Mrs. S. Mahalakshmi, Assistant Professor, Dept. of ISE.
I also declare that this project report has not been submitted for the award of any degree,
diploma, associate ship, fellowship or other title anywhere else.
Signature
ii
ABSTRACT
Bangalore city faces severe problems of road congestion and associated issues of
commuters, which include delays in the arrival of buses at bus stops, lack of information about
different bus routes and stops and time. College students/staffs will miss their bus by a fraction
of second. This will lead to many problems like being late for the classes and sometimes late
for the exams also. To overcome this we have implemented a Smart Bus Tracking System.
This system is used to track the BMSIT college buses.
The proposed system uses a Smartphone application. Buses carry Global Positioning
System (GPS) devices to track their positions and Google Maps API is used to display the
vehicle on the map in the Smartphone application. It shows where exactly the bus is there on
the map and provides updated information to the user at different time intervals. This also
displays the estimated arrival time, which helps the user to know when exactly the bus is
going to reach his/her stop.
Apart from this our system also provides the congestion details for driver. It provides
the alternate routes for the driver if there is any congestion in his route. The next major
advantage is, if the bus is in any emergency situation it sends an alert message to the
transport in charge. The user can get flexibility of planning travel using the app, to decide
when to catch the bus. The proposed system is user friendly and ensures safety and
surveillance at low maintenance cost.
iii
INDEX
ACKNOWLEDGEMENT……………………………… i
DECLARATION………………………………………... ii
ABSTRACT……………………………………………... iii
LIST OF FIGURES…………………………………….. iv
LIST OF TABLES……………………………………… v
1 Introduction [1-8]
1.1 Background 1
1.2 Android 3
1.3 GPS Tracking unit 5
1.4 Motivation 8
iv
4.3 Dataflow diagram 33
4.4 Algorithm 34
4.5 Class diagram 35
5 Implementation [36-45]
5.1 Platform selection 36
5.2 Programming language gist 37
5.3 Module description 37
5.4 Coding Standards 45
BIBLIOGRAPHY
APPENDIX
A PLAGIARISM REPORT
v
LIST OF FIGURES
Figure Figure name Page No.
No.
1.1 Bus Tracking System Architecture ……………………............. 2
1.2 Android Architecture ……………………………….................. 4
1.3 Architecture of GPS ………………………………………........ 7
3.1 Use Case Diagram …………………………………………....... 23
4.1 Design and Architecture ………………………………………... 25
4.2 Activity diagram for bus tracking ……………………………..... 32
4.3 Dataflow diagram ……………………………………………...... 33
4.4 Class diagram ………………………………………………........ 35
LIST OF TABLES
TableNo. Table Name Page No.
vi
Smart Bus Tracking System Introduction
CHAPTER 1
INTRODUCTION
1.1. BACKGROUND
Vehicle tracking systems were first implemented for the shipping industry because
people wanted to know where each vehicle was at any given time. These days, however, with
technology growing at a fast pace, automated vehicle tracking system is being used in a
variety of ways to track and display vehicle locations in real-time.
However, bus transportation service has very poor transportation information system
nowadays. Bus users do not know the exact arrival time for a bus, but only know the
scheduled approximate arrival time. Bus transportation service does not have a proper system
to track all buses position and the actual arrival time in every bus stop. These problems occur
because current bus service system did not apply real time tracking technology to track on
each buses on the road and also lack of a platform to update latest bus traffic information to
bus users.
In order to solve these problems and enhance current bus service system, real time
bus tracking system has to develop and implement. With real time bus tracking system, bus
position data is connected real time and transmitted to a central server for processing and
extracting transit information. The main technology used to develop this system is Global
Positioning System (GPS). GPS technology able to receives the position of an object from
space-based satellite navigation system through a GPS receiver.
For wireless data transmission, GSM and SMS technology are commonly used. The
SMS technology through GSM network and GSM modem provide a user with vehicle
location information. Instead of using SMS, the bus tracking system uses the smart phone
application to track and monitor a bus location obtained from the in-vehicle tracking device.
The bus location is automatically placed on Google maps, which makes it easier for tracking
a vehicle and provides users with more accurate vehicle location information.
The developed bus tracking system will be able to provide bus users a real time
platform to check on updated bus traffic information, for example bus arrival or departure
time. Besides, this system also reduces workload for bus management team and provides an
immediate platform to update latest and accurate bus traffic information to bus users.
1.2. ANDROID
1.2.1. Overview
Android is a mobile operating system (OS) currently developed by Google, based on
the Linux kernel and designed primarily for touchscreen mobile devices such as smartphones
and tablets. Android's user interface is mainly based on direct manipulation, using touch
gestures that loosely correspond to real-world actions, such as swiping, tapping and pinching,
to manipulate on-screen objects, along with a virtual keyboard for text input. In addition to
touchscreen devices, Google has further developed Android TV for televisions, Android
Auto for cars, and Android Wear for wrist watches, each with a specialized user interface.
Variants of Android are also used on notebooks, game consoles, digital cameras, and other
electronics. Now we have phones which can even access GPS, GPRS, Wi-Fi, NFC and lot of
other cool and advanced features which you cannot even imagine. So in this Mobile world of
this complication, android is one of those operating system platforms which made it easy for
manufacturers to design top class phones.
Stored and copied to a stream where the actual data is transferred. Due to its native
characteristic, it runs in the background and waits for a possible transfer operation. They are
called right after the related button is pressed. Services retrieve values from static class called
FinalValues.java through intent's extended data. They mainly include Final Values
.EXTRAS_GROUP_OWNER_ADDRESS and Android OS.
As it is widely known, android is a Linux-based operating system led by Google. It is
mostly developed for mobile devices to bring simplicity, functionality and efficiency to the
market. Android is an open source project and it has a large number of developers writing
applications. Developers write applications primarily in Java (Stephen Shankland, 2007) and
applications can be downloaded mostly through official online store called Google Play.
Currently there is 600,000 applications available on Google Play and so far 20 billion
applications downloaded from this store (engaged, 2012).
Android runs on Linux with libraries and libraries written in C. Dan Morrill, Android
Engineer in Google, explained that Android is not a specification, or a distribution in the
traditional Linux sense. It's not a collection of replaceable components. Android is a chunk of
software that you port to a device. (Dan Morrill, 2010)
Android uses the Dalvik Virtual Machine to run Dalvik Executable code translated
from Java byte code. All standard APIs are defined in terms of classes, interfaces, methods
and objects. In terms of hardware platform, ARM architecture is main platform for Android.
However, there is also support for x86 architecture.
1.2.2. Architecture
Architecture Android runs on Linux under Dalvik VM. Dalvik has a just-in-time
compiler where the byte code stored in memory is compiled to a machine code. Byte code
can be defined as ‘intermediate level'. JIT compiler reads the byte code in many sections and
compiles dynamically in order to run the program faster. Java performs checks on dependent
portions of the code and thus the code is compiled only before it is executed. When it is
compiled once, it is cached and set to be ready for later uses.
data pushers additionally contains the GSM/GPRS modem to transmit this information to a
central computer either via SMS or via GPRS in form of IP packets.
Fundamentals: The GPS concept is based on time and the known position of
specialized satellites. The satellites carry very stable atomic clocks that are
synchronized to each other and to ground clocks. Any drift from true time maintained
on the ground is corrected daily. Likewise, the satellite locations are known with
great precision. GPS receivers have clocks as well; however, they are not
synchronized with true time, and are less stable. GPS satellites continuously transmit
their current time and position. A GPS receiver monitors multiple satellites and solves
equations to determine the precise position of the receiver and its deviation from true
time. At a minimum, four satellites must be in view of the receiver for it to compute
four unknown quantities (three position coordinates and clock deviation from satellite
time).
Mobile Phones with GPS Capability: Due in part to regulations encouraging mobile
phone tracking, including E911, the majority of GPS receivers are built into mobile
telephones, with varying degrees of coverage and user accessibility. Commercial
navigation software is available for most 21st- century smartphones as well as some
Java-enabled phones that allow them to use an internal or external GPS receiver (in
the latter case, connecting via serial or Bluetooth). Some phones using assisted GPS
(A-GPS) function poorly when out of range of their carrier's cell towers. Others can
navigate worldwide with satellite GPS signals as well as a dedicated portable GPS
receiver does, upgrading their operation to A-GPS mode when in range. Still others
have a hybrid positioning system that can use other signals when GPS signals are
inadequate.
subscribers who are near to advertising restaurants, cafes, movie theatres. The
Singaporean mobile operator Mobile One carried out such an initiative in 2007 that
involved many local marketers, what was reported to be a huge success in terms of
subscriber acceptance. Companies offering location-based messaging (sometimes
referred to as "geo-messaging") include The Coupons App (US), Central
(International), Zhiing (international), BluePont (US), Dodgeball (US) and Beamster
(Austria).
1.4. MOTIVATION
Many cities have found that GPS tracking system not only improve the efficiency of
city bus operation, but also encourage commuters to take the advantage of city bus system.
Many city bus systems have discovered that GPS tracking system allows monitoring the
location and arrival time of their bus actually increase the number of people using city buses
for routine communing. The application is a user friendly one that anyone can access for free
of cost. The basic idea for this project was to guide the bus travelers with the routes, all the
possible stops that come on their way to the destination and moreover, display maps and
track their locations and show the estimate remaining time required to reach. The aim is to
overcome all the drawbacks faced in all the previous applications and generate fast and
accurate results.
CHAPTER 2
LITERATURE SURVEY
The existing platforms and applications that are used to assist commuters plan their
travel uses mobile data for the connectivity and communication and GPS to get the real-time
location of the bus (or other means of transport) relative to the commuter. There are solutions
that offer a limited accuracy in metropolitan cities. However, these solutions are not available
to the other cities and also, they rely on historical data to provide information.
The Intelligent Transport System (ITS)s based solutions can be studied to overcome
these pitfall, would help the commuter to effectively utilize the public transport which
includes lower waiting time.
There are many implementations of Intelligent Transport System all around the world, each
solution designed to address a specific demographic region. There are existing solutions like
tram TRACKER by Yarra Technologies in Melbourne, Australia and Google Maps is always
there to cater the needs of the metropolitan commuters. The components of ITS Technologies
are the wireless communication like Wi-Fi, WiMAX, RFID, etc. and computational
technologies like AI, Real time data processing, etc.
The location of the bus can be observed continuously using GPS system. The GPS
satellites transmit signals to a GPS receiver. These receivers statically receive signals. GPS
satellite transmits data that indicates the location and current time of the vehicle. The Smart
Card provides, identification, application processing along with data storage. Every
passenger will carry the smart card. The Smart Card holds information of the user such as
available balance, identification number, user’s information.
These smart cards are capable of recharge. By integrating both GPS technology and
smart cards we are going to design a whole bus ticketing system. Whenever the passengers
will enter in the bus he/she will be asked by the conductor whether he/she wants to buy ticket
by using smart card or money. If smart card is used, then the conductor will swipe smart
card. Then validity and of smart card will be checked with server and then the ticket will be
issued. According to Source and destination the distance covered by passenger is get
calculated and according to that bus fare amount will be reduced from smart card. The smart
cards will also useful for conductor for fast issuing the tickets to the passengers.
The system also has many additions feature to make public transport system an
intelligent and easy to use system, so that public can take smart advantage of it. The system
is specially designed for Smart Cities as it is trending now-a-days. The basic idea of
producing smart public transport system is to be developed on ARM system using GPS/GSM
technology. The basic need to develop this system is to minimize public time issues related to
public transport system. Features to be implemented in the system are vehicle tracking
Department of IS&E, BMSIT&M 11 2017-18
Smart Bus Tracking System Literature Survey
(online/offline), availability of no. of seats in the vehicle (bus), engine heat monitoring in the
bus, women safety, accident detection, and various other features.
The buses will be monitored live using coordinates with this system. Also by
implementing geofence, user get notify once bus entered in his/her predefined area. We are
developing an Android-application which will give the real-time schedule of buses. Also, it
provides quick and real-time replay for inquiry, via the server. Also in case of any
unexpected activities or breakdown, the alert will be sent to the system, with Bus location.
The transportation system provide as the heart in the social and economic-growth of
the country. As the population in India is increasing, rapid explode in rate of vehicles which
results in an overload on traffic management. Public transport is becoming an important part
of transport system in urban areas, advance in easily available technology Can be enforced
which help the passenger who recalculate between a rural and urban to-get the travelling
information and it helps the passengers to comfort them with the final real time location.
Public transport mainly the bus sluice has been properly developed in many parts of the
world.
For reducing the fuel-usage, snobby usage of car and comfort traffic crowding we can
use the bus services. Passengers require the exact schedule of bus. The anxiety of passengers
increases while waiting for a longtime at the bus stop and changes their mind to opt for the
Department of IS&E, BMSIT&M 13 2017-18
Smart Bus Tracking System Literature Survey
buses. Many passengers are usually on-time for office and many students restarted to their
classes as they determine to stop for the buses instead-of taking another mode of
transportation. Goal of system is to decrease the complexity and cost of content these
services by implementing Easy-Tracker, an auto system for the transit-tracking and advent
time prediction.
Mumbai's travel portal has details about Harbour, Central and Western railway local
trains. You can find the schedule of trains between any two stations with time table;
maps, single journey return journey, and monthly season pass fare details.
Route information and timetable of Mumbai Monorail and Metro train is also
available on Go4Mumbai website.
Go4Mumbai website also lists the options to travel in Mumbai using various cab
services like Meru, Tabcab, EasyCabs, Uber, Ola or private cabs.
In case if three or less than 3 people are traveling, options for Auto rickshaw is also
provided. There details on Toll Plazas with Toll amount for private and public
vehicles.
Its latest updates have given issues on every Android mobile supporting even the
most recent device version. The “A to B” module of buses has given problems.
Whenever an option for the source to destination is selected, the field still remains
blank, i.e. no bus routes are displayed.
It has drawbacks like: The application works smoothly when offline, but works very
badly when connected to the Internet. The application gives information about direct
routes only.
It does not give information about the alternate routes. This application has bugs due
to which it lags all the time. Most of the time the application crashes when requested
for specific bus routes.
The bus commuter can update the current location of the bus during their travel by
just updating “spot” and the app will use the current location retrieved through the
GPS of the user’s phone as the current location of the bus.
The “MY MTC” app also allows users to tag their favorite buses and get regular and
real-time updates about the location of that bus. The commuters can even check the
bus location by using “find”. The app makes use of efficient algorithms to make this
tedious process look easy and fast.
The app comes packed with very interesting and impressive features. It provides the
commuters with real-time notifications and information about the bus. It makes
spotting and finding of a bus a real easy task.
The app even lets a user find the nearest bus stop from their current location through
their phone’s GPS. In order to make travelling by buses easier and worry free, the app
provides the users with the route maps of the bus route. It even provides them with
them information like distance, bus fare and number of stops about the bus.
“Chennai Bus Route” has the following drawbacks: The application works fine, but
the bus timings have not been mentioned. Not all bus stops are updated. The
application does not display maps.
There are many existing platforms and applications that are used to assist commuters
plan their travel uses mobile data for the connectivity and communication and GPS to get the
real-time location of the bus (or other means of transport) relative to the commuter. There are
solutions that offer a limited accuracy in metropolitan cities.
However, these solutions are not available to the other cities and also, they rely on
historical data to provide information. The Intelligent Transport System (ITS)s based
solutions can be studied to overcome these pitfall, would help the commuter to effectively
utilize the public transport which includes lower waiting time. There are many
implementations of Intelligent Transport System all around the world, each solution designed
to address a specific demographic region. There are existing solutions like tram TRACKER
by Yarra Technologies in Melbourne, Australia and Google Maps is always there to cater the
needs of the metropolitan commuters.
The components of ITS Technologies are the wireless communication like WiFi, WiMAX,
RFID, etc. and computational technologies like AI, Realtime data processing, etc. The
solution is also loosely based on the Floating car data, which is based on the collection of
position, speed and direction of travel of the vehicles from mobile phones with a two-way
communication of GPS enabled vehicles with Smartphone based applications. The task of
computing the shortest path of travel is computed with Dijkstras Algorithm the optimizations
done are discussed in section III. Communication protocol used to develop this prototype
uses 3G for internet connectivity with MQTT[5,6] for message passing from the bus to the
commuters. MQTT enables the bus to interact with the commuter directly.
It is particularly annoying when a person has urgent appointment, but we are late due to
the time-consuming of bus trip.
4. Bangalore city faced severe problems of road congestion and associated issues of
commuters, which include delays in the arrival of buses at bus stops, lack of information
about different bus routes and stops and time. College students/staffs will miss their bus
by a fraction of second. This will lead to many problems like being late for the classes
and sometimes late for the exams also.
5. Students also cannot check on the updated bus schedule if there is a bus delay happens.
For example, student can choose walk to the building he or she want to go instead of
waiting for a delay bus if there is a real time platform for student to know about the bus
is delay.
2.14. OBJECTIVES
The objective of bus tracking system is,
• The mobile phone industry is one of the fastest and most dynamic business sectors
today. The need to communicate efficiently and instantaneously is always an undying
necessity. The market sector and the ever-growing and demanding consumers always
want to have more, and they want it better than ever. Having a mobile phone for us
makes life easier.
• Communication is always a part of daily life, and we cannot avoid it. The invention
of mobile phone has gone tremendous leaps in innovation and new applications.
Originally, it was intended to be a telephone that can be carried wirelessly at greater
distances.
• Advances in communications, upgrades in radio frequency and developments on the
internet had given mobile phones more sophisticated but easy to use in applications.
• The main goal of the proposed work is to improve the Bus system by adding the
necessary additional features into the application, like accurate bus timings, correct
bus numbers and moreover adding a GPS tracker into it.
• This study accepts input in the form of selection of the bus, to track the location of the
respective bus and give the map for the same. It can also show the expected time
required for the bus to reach the user.
• To inform drivers/user regarding diversion of route in case of heavy traffic or
congestion.
• Emergency situations can also be informed to the transport in charger.
CHAPTER 3
NON-FUNCTIONAL REQUIREMENTS
The system should provide the accurate estimated bus arrival time to user.
The system should reduce the paper work done by bus management team.
The system should be able to increase the efficiency and performance of bus service.
The system should reduce work done by bus management team by automated calculation
of estimated bus arrival time and showing real time bus position to user.
The system should allow user to access information in anywhere with anytime.
Actor:
Student
Faculty
Driver
Transport in charge
Bus application
Use-case:
Get the bus location
Get the bus information
Get current location
Send location
Update location
Emergency
Pre-condition:
GPS in bus should be working properly and should send the coordinates to the server
Post-condition:
Mobile application should receive location of bus from server
CHAPTER 4
The interface design of bus information must be as simple as possible so that bus users
able to get information easily. The application is divided into three main parts, which is map with
bus position, congestion details and emergency.
The first segment is the extraction of the information from the API, second is navigation
using Google maps for traffic and third is getting the current location and sending SMS. Core
operations of the entire system is carried out with these two classes, namely as MainActivity.java
and Routes.java
The first module in the app is the commuter module. The commuter module contains two
different buttons, one is for bus 1 and the other is for bus 2. Users can click on the respective
buttons. By clicking so, they can get the latitude and longitude information of where exactly the
bus is located in the form of a red marker along with the Estimated Arrival Time (ETA).User
location is also highlighted in the app in the form of a blue circle .It also shows the name of the
location. When the user clicks on the directions button, it shows the exact distance between the
user and the bus.
The second module is the driver module. This module also has two buttons which
correspond to the two routes. When the driver clicks on the respective routes, he can get the
traffic details on his routes. Red color indicates high traffic; orange color indicates medium
traffic whereas blue color indicates no traffic.
The last module is the Emergency module. If there is any emergency situation like
breakdown of bus, accident and so on, the user can click on the emergency button. When he/she
clicks on the button, an alert box will be displayed to confirm whether he/she needs the help or
not. By clicking on the yes option, a SMS will be sent to the transport in charge of the college
along with the exact location of the bus.
Apart from this, the app contains a navigation drawer which includes three different
options: Route map, Know your driver and Feedback. Route map specifies each of the stops
along the respective route. Two radio buttons have been incorporated for this purpose. If the user
wants to get to know any information regarding the driver, he can click on the Know Your
Driver option.
4.1.2.XmlPullParser Factory
Android recommends usingXMLPullParser to parse the xml file than SAX and DOM
because it is fast. The org.xmlpull.v1.XmlPullParser interface provides the functionality to parse
the XML document using XMLPullParser.
xmlPullParserFactory = XmlPullParserFactory.newInstance();
newInstance(): Creates a new instance of a PullParserFactory that can be used to create XML
pull parsers.
Android application runs on a single thread when launched. Due to this single thread
model tasks that take longer time to fetch the response can make the application non-responsive.
To avoid this we use android AsyncTask to perform the heavy tasks in background on a
dedicated thread and passing the results back to the UI thread. Hence use of AsyncTask in
android application keeps the UI thread responsive at all times.
The basic methods used in an android AsyncTask class are defined below :
2. onPreExecute() : This method contains the code which is executed before the
background processing starts
3. onPostExecute() : This method is called after doInBackground method completes
processing. Result from doInBackground is passed to this method
4. onProgressUpdate() : This method receives progress updates from doInBackground
method, which is published via publishProgress method, and this method can use this
progress update to update the UI thread
The three generic types used in an android AsyncTask class are given below:
1. Params : The type of the parameters sent to the task upon execution
2. Progress : The type of the progress units published during the background computation
3. Result : The type of the result of the background computation.
5. Disconnect. Once the response body has been read, the HttpURLConnection should be closed
by calling disconnect(). Disconnecting releases the resources held by a connection so they
may be closed or reused.
Android uses URI string as the basis for requesting data in a content provider (i.e. to
retrieve a list of contacts) and for requesting actions (i.e. opening a webpage in a browser).
Intents let you start an activity in another app by describing a simple action you'd like to
perform (such as "display a map" or "show directions to the airport") in an Intent object. The
Google Maps app for Android supports several different intents, allowing you to launch the
Google Maps app and perform one of four actions:
Display a map at a specified location and zoom level: Search for locations or places,
and display them on a map. Request directions from one location to another. Directions
can be returned for three modes of transportation: driving, walking, and bicycling.
Use of geo: Intent to display a map at a specified location and zoom level. q defines the
place(s) to highlight on the map. The q parameter is required for all Search requests. It
accepts a location as either a place name or address.
4.1.6. LocationManager
This class provides access to the system location services. These services allow
applications to obtain periodic updates of the device's geographical location, or to fire an
application-specified Intent when the device enters the proximity of a given geographical
location.
LocationListener: Used for receiving notifications from the LocationManager when the
location has changed. These methods are called if the LocationListener has been
registered with the location manager service using the requestLocationUpdates(String,
long, float, LocationListener) method. The methods of LocationListener are:
1. onLocationChanged:
voidonLocationChanged (Location location)
Called when the location has changed.
2. onProviderDisabled:
voidonProviderDisabled (String provider)
Called when the provider is disabled by the user. If requestLocationUpdates is
called on an already disabled provider, this method is called immediately.
3. onProviderEnabled:
voidonProviderEnabled (String provider)
Called when the provider is enabled by the user.
4. onStatusChanged:
voidonStatusChanged (String provider, int status, Bundle extras)
Called when the provider status changes. This method is called when a
provider is unable to fetch a location or if the provider has recently become
available after a period of unavailability.
getLatitude(): Get the latitude in degrees.
getLongitude(): Get the longitude in degrees.
4.1.9. Geocoder
A geocoder is either a piece of software or a service that implements a geocoding process. The
Android API contains a Geocoder class that can use either a location name or a location's latitude
and longitude values to get further details about an address (it can perform both forward and
reverse geocoding).
Public constructors are:
Geocoder(Context context, Locale locale):Constructs a Geocoder whose
responses will be localized for the given Locale.
Geocoder(Context context):Constructs a Geocoder whose responses will be
localized for the default system Locale.
4.1.10. SmsManager
Manages SMS operations such as sending data, text, and pdu SMS messages. Get this
object by calling the static method getDefault().SmsManager class is responsible for sending
SMS from one emulator to another or device.SmsManager class is responsible for sending SMS
from one emulator to another or device.
4.4. ALGORITHM
Step1. There are three different option’s commuter, driver and emergency. The students/staff can
click on the commuter option to get the bus location.
Step2. In step 2, the respective students/staff can click on their routes. By clicking on their routes
they get the information of where exactly there bus is located on the Google maps.
Step3. In the same way, the driver can click on the driver option to get congestion details. When
the bus 1 driver clicks on his route he gets the traffic details. In the same way Bus 2 driver can
click on his route.
Step4. The last option is emergency, the students/staff and driver can click on emergency button
if there is any bus break down or accident and so on. By clicking on that option an SMS will be
sent to transport in charge along with the location.
CHAPTER 5
IMPLEMENTATION
It is the official integrated development environment (IDE) for Google's Android operating
system, built on JetBrains' IntelliJ IDEA software and designed specifically for Android
development. It is available for download on Windows, macOS and Linux based operating
systems. It is a replacement for the Eclipse Android Development Tools (ADT) as primary IDE
for native Android application development.
JAVA
It’s object-oriented
Project is designed in four parts where each part is responsible for different aspects.
Essentially, main activity handles instantiate methods and pre-configuration process for Location
Manager class such as manage the previous location, current location and status check whether
GPS is on or off.
The first step involves the extraction of the GPS coordinates from the server. The two
URL’s , one for Route 3 and the other one for Route 6 is as follows:-
Route 3: http://103.230.38.203/vehicleinfo/ITSNEW.asmx/getMyData?VehicleNo=KA-05-C-
415
Route 6: http://103.230.38.203/vehicleinfo/ITSNEW.asmx/getMyData?VehicleNo=KA-50-806
In order to extract the latitude and longitude from the XML , we use the XmlPullParser interface.
XML Pull Parser is an interface that defines parsing functionality provided in XMLPULL V1
API. This is a simple interface – parser consists of one interface, one exception and one factory
to create parser.
Prolog : The first line that contains the information about a file is prolog. Typically this
is the line:
Events : Events in an XML file include simple start and end tags and more
Text : It’s simple text in between two tags. Example: My Text</RandomTag
Attributes : Attributes are the additional properties of a tag that are present within the
tag. Example : Some Text or nested tags.
try {
xmlPullParserFactory= XmlPullParserFactory.newInstance();
xmlPullParserFactory.setNamespaceAware(false);
parser = xmlPullParserFactory.newPullParser();
} catch (XmlPullParserException e) {
e.printStackTrace();
}
if(eventType == XmlPullParser.START_TAG){
name = parser.getName();
if(name.equals("lat")){
mEntity.lati= parser.nextText();
}
else if(name.equals("lon")){
mEntity.longi= parser.nextText();
}
}
eventType = parser.next();
}
return mEntity.lati+ ", " + mEntity.longi;
}
The Google Maps app for Android supports several different intents, allowing you to
launch the Google Maps app and perform actions
Use of geo: Intent to display a map at a specified location and zoom level. q defines the place(s)
to highlight on the map.
Here geo?q= takes the latitude and longitude of the bus and displays the location of the bus using
a marker on Google maps.
// turnGPSOn();
} else {
mlocManager.requestLocationUpdates(LocationManager.NETWORK_PROVIDER, 0,
0, mlocListener);
}
}
{
c_lat = loc.getLatitude();
c_long= loc.getLongitude();
Toast.makeText( getApplicationContext(),
Toast.LENGTH_SHORT).show();
mlocManager.removeUpdates(mlocListener);
getAddress();
String geoCode =
"https://www.google.com/maps/dir/?api=1&origin=BMSCE,Bengaluru&destination=BMSIT,Benga
luru&waypoints=Lalbagh+West+Gate%2CBengaluru%7CMallya+Hospital%2CBengaluru%7CHalasuru+
Police+Station%2CBengaluru%7CColes+Park%2CBengaluru%7CTV+Tower%2CJayamahal+Main+Road%2
CBengaluru%7CRT+Nagar+Police+Station%2CBengaluru&travelmode=driving&dir_action=navigat
e";
This API lets us use Google maps in order to display the traffic details. Here we specify the
origin and destination and the mode of travelling.
To send SMS :
Sms Manager class is responsible for sending SMS from one emulator to another or
device. MY_PERMISSION_REQUEST_SMS and SEND_SMS checks for permission and
allows the application to send the SMS.
A Geocoder class uses either a location name or a location's latitude and longitude values
to get further details about an address.
Geocodergeocoder;
List<Address>addresses;
geocoder = new Geocoder(this, Locale.getDefault());
} else {
// permission is already granted
ActivityCompat.requestPermissions(this,
new String[]{Manifest.permission.SEND_SMS},
MY_PERMISSIONS_REQUEST_SEND_SMS);
}
} else {
SmsManagersmsManager = SmsManager.getDefault();
smsManager.sendTextMessage("+918105730024", null, "Help Needed. Location: " + address ,null, null);
Toast.makeText(getApplicationContext(),
"SMS Sent Successfully",
Toast.LENGTH_LONG).show();
CHAPTER 6
SOFTWARE TESTING
Software testing is a process used for verifying the correctness, completeness and quality
of the developed software. Software is built out of sub-systems that are composed of modules,
which in turn are composed of procedures and functions.
The sequence of testing activities performed for the tracking system is as below:
Unit Testing
Integration Testing
System Testing
Functional testing
Black Box Testing: In this strategy some test cases are generated as input conditions that fully
execute all functional requirements for the program.
White Box testing: In this the test cases are generated on the logic of each module by drawing
flow graphs of that module and logical decisions are tested on all the cases.
2 To ensure that the 1) Run the module installed The module Pass
module able to in smart phone. should be
receive data from 2) Observe the data able to
server. receive
information
from server.
4 To ensure that the 1)Run the driver module The module Pass
traffic details are 2)Check for traffic in must change
updated on Google different areas route as
maps traffic
changes
5 To ensure the SMS is 1)Run the emergency The Pass
sent properly to the module transport in
destined number and 2)Click yes when prompted charge must
with the correct for confirmation get the SMS
location. along with
the location
Table 6.1: Unit Testing
Involves in-house testing of the entire system before delivery to the user. Its aim is to
satisfy the user the system meets all requirements of the client's specifications.
CHAPTER 7
SCREENSHOTS
Navigation Drawer
Feedback
About us
CHAPTER 8
8.1. CONCLUSION
In this present situation Bangalore city is facing lots of problem due to traffic and so on.
One among the major problem is, the students/staff will miss there buses in fraction of second,
which may leads to problem like being late for classes, exams and so on. To overcome this kind
of problem, Smart Bus Tracking System was introduced. In this system there are three different
modules:
The first module is the commuter module, when the users wants to know where
exactly there bus is located they can click on this module, so that they get the
information of their bus on the Google maps along with Estimated Time Of
Arrival.
The second module is the driver module, if the driver wants know the traffic
details in his route. He can click on the module. By clicking so, the traffic will be
displayed on the Google maps.
The last module is emergency module. If there is any emergency situation like
accident, breakdowns etc. the users/driver can send an SMS to the transport in
charger.
8.2. LIMITATIONS:
Our tracking system is not secured because it can be accessed by any unauthorized
persons also.
Our application doesn’t work if the GPS is not turned on in the user’s phone.
Only the transport officer receives the bus break down details.
Delay of the bus is not informed for the commuter in early stage.
The student or staff will not get any alarm notification regarding the crossing of buses
from each stop.
Department of IS&E, BMSIT&M 56 2017-18
Smart Bus Tracking System Conclusion & Future Enhancement
Our application is not so secured; it can be accessed by everyone. In future, the login
details should be provided so that only the people who are travelling in BMSIT college
bus and also who have paid the transportation fee can access the location of the bus.
An alert message or notification should be sent to the user whenever the bus arrives to the
stop or crosses the stop.