Ben Romberg Asim Fayyaz Marilee Kowalczyk Mike Hruby Nathan Risto Shuja Ahmed THE HAMMERS.
Android Project report on City Tourist Location based services (Shuja ul hassan)
-
Upload
hassan-tabraiz -
Category
Software
-
view
242 -
download
14
Transcript of Android Project report on City Tourist Location based services (Shuja ul hassan)
Skardu City Tourist Guide(An Android Application)
Session (2013-15)
Program
Master of Information Technology (2 years)
Submitted By:
Shuja ul Hassan (2013-KIUSC-1085)
Supervised By:
Dr. Irshad Ali
Assistant ProfessorComputer Science Department
Karakoram International UniversityGilgit-Baltistan, Skardu campus
DEDICATION
With my deepest gratitude I dedicate this thesis to myfamily and teachers, without their patience, understanding andsupport completion of this work would not have been possible.Who has been a constant source of knowledge and inspiration.
i
DECLARATION
It has been declared that I have developed this Application
and its project report.To complete this report I have used my
own knowledge and made personal efforts under direction of my
supervisor.
Any part of this report has not been used to get degree from
the university and any other universities.
Shuja ul Hassan
ii
ACKNOWLEDGMENT
I express my thankfulness to the Almighty Allah for His count-
less blessings. The successful completion of this project has
become possible due to regular guidance and support of my su-
pervisor and teachers so it is an obligation to convey gratefulness
and admiration to all those persons behind the scene who di-
rected, motivated and assisted. As the first consideration I will
express my thankfulness to Prof. Dr Irshad Ali my project su-
pervisor. He motivated and helped to the complete this project.
He made me believe that I can do it. He was accessible to me
whenever I seek advice from him. Without his important guid-
ance and help, I could never be able to create this project. I also
extend my thanks to my mentors including Asst.Prof Jawad Us-
man(HOD), Lecturer Mr.Naseem Abbas, Lecturer Mr. Imtiaz
Ahmed, Lecturer Mr. Imran Ali and Lecturer Mr. Nauman Ali
Khan who assisted and motivated me to complete this project.
Finally, I am so thankful to my family, class fellows and se-
niors for their co-operation and support.
iii
Contents
Declaration . . . . . . . . . . . . . . . . . . . . . . . ii
Acknowledgment . . . . . . . . . . . . . . . . . . . . iii
Abstract . . . . . . . . . . . . . . . . . . . . . . . . ix
1 Introduction 1
1.1 Introduction . . . . . . . . . . . . . . . . . . . 2
1.2 Problem statement . . . . . . . . . . . . . . . . 3
1.3 Objectives . . . . . . . . . . . . . . . . . . . . 4
1.4 Limitation and Scope . . . . . . . . . . . . . . 5
1.4.1 Scope . . . . . . . . . . . . . . . . . . . 5
1.4.2 Limitation . . . . . . . . . . . . . . . . 5
1.5 Outline of the thesis . . . . . . . . . . . . . . . 6
2 Literature Review 7
2.1 Static Map Approaches . . . . . . . . . . . . . 8
2.1.1 Personal Activity Travel Surveys . . . . 8
2.1.2 The Services Based on Location . . . . 9
2.1.3 Security . . . . . . . . . . . . . . . . . . 10
2.2 Challenges . . . . . . . . . . . . . . . . . . . . 10
2.3 Existing Solutions . . . . . . . . . . . . . . . . 10
2.4 Use of Google Map API . . . . . . . . . . . . . 14
2.5 Location Detection . . . . . . . . . . . . . . . . 15
2.6 Calculate Distance Between two Locations . . . 16
2.6.1 Disjkstra’s Algorithmic-Code . . . . . . 20
iv
3 Methodology 22
3.1 Android Architecture . . . . . . . . . . . . . . 23
3.2 Life Cycle of Android Application . . . . . . . . 25
3.2.1 Active and Running state . . . . . . . . 25
3.2.2 Paused state . . . . . . . . . . . . . . . 25
3.2.3 Stopped state . . . . . . . . . . . . . . 26
3.2.4 Destroyed/Dead state . . . . . . . . . . 26
3.3 Android Versions and Its latest comparison . . 28
3.4 Project Contribution . . . . . . . . . . . . . . . 30
3.4.1 Direction . . . . . . . . . . . . . . . . . 30
3.4.2 Locations . . . . . . . . . . . . . . . . . 30
3.4.3 Nearby Places . . . . . . . . . . . . . . 33
3.4.4 Weather . . . . . . . . . . . . . . . . . 33
3.4.5 Social Networking . . . . . . . . . . . . 33
3.4.6 Map Marker Information . . . . . . . . . 33
3.5 Fundamentals of Application . . . . . . . . . . 33
3.6 Skardu City Guide Application Architecture . . 38
3.7 Showing Distance Between Two Locations by Draw-
ing Polylines . . . . . . . . . . . . . . . . . . . 42
3.8 Development of Software . . . . . . . . . . . . 46
3.9 Summary of Guide . . . . . . . . . . . . . . . 46
4 Experimental Results 47
4.1 Starting of Application on Android Smartphone 49
4.1.1 Location Based Services . . . . . . . . . 49
4.1.2 Direction Between two Places . . . . . . 51
4.2 Location on Map by Markers . . . . . . . . . . 53
4.3 Weather forecasting and social networking . . . 53
4.4 Location . . . . . . . . . . . . . . . . . . . . . 53
v
5 Conclusion and Future Enhancements 54
5.1 Conclusion . . . . . . . . . . . . . . . . . . . . 55
5.2 Future Enhancements . . . . . . . . . . . . . . 55
vi
List of Figures
2.1 Find a Location using GPS based Android Smart
Watch . . . . . . . . . . . . . . . . . . . . . . 9
2.2 Global Positioning System (GPS ) with 4 satellite
connected out of 24 . . . . . . . . . . . . . . . 13
2.3 Google Maps . . . . . . . . . . . . . . . . . . . 14
2.4 Example image for the following Dijkstra’s algo-
rithm’s Analysis . . . . . . . . . . . . . . . . . 18
3.1 Android Architecture Reprinted from android-
havies.com . . . . . . . . . . . . . . . . . . . . 24
3.2 Android Application Life Cycle reprinted from
strawflower.com . . . . . . . . . . . . . . . . . 26
3.3 Android Versions and Its latest comparison (Pic-
ture Reprinted from PhonDriod.com) . . . . . 29
3.4 Showing location with time and distance . . . . 31
3.5 Shows locations activity and detail activity . . 32
3.6 Shows multiple nearby places . . . . . . . . . . 34
3.7 Shows weather forecast activity with details . . 35
3.8 Shows social networking group page . . . . . . 36
3.9 Shows customize markers on map . . . . . . . 37
3.10 Skardu City Guide Application Architecture . . 40
3.11 Skardu City Tourist Guide Application Main Menu
41
vii
3.12 Distance Between two Location with time and
kilometer . . . . . . . . . . . . . . . . . . . . 43
3.13 Main map of Skardu . . . . . . . . . . . . . . 44
3.14 Distance Between two Location by Drawing Poly-
lines . . . . . . . . . . . . . . . . . . . . . . . 45
4.1 Skardu City Guide Splash Screen . . . . . . . . 48
4.2 A marker is showing view of jinnah park and
other customize markers . . . . . . . . . . . . 50
4.3 Direction showing by drawing polyline on the
Map between to Cities Skardu and Gilgit . . . 52
viii
ABSTRACT
The aim to design and develop this project is to produce a
tourist guide for Skardu city, which can efficiently guides the
tourist who visits Skardu.Due to its natural beauty many do-
mestic and international tourist visits every year. The Android
tourist guide can be use in place of professional guide due to
many reasons like reduce cost of guide, get more accurate in-
formation needed for decision making, giving weather and so-
cial networking services. The tourists can use this guide for
different purposes like searching a location , calculate distance
between two locations,getting basic textual information, picto-
rial information of location which normally we could not find in
default Google maps.The guide uses Google Map API, global
positioning system( GPS), Internet and cellular data to provide
its services. A Smartphone with Internet connection is required
to use this application. The Google Maps API uses Dijkstra’s
algorithm to calculate paths. The built in GPS(global posi-
tioning system) of smartphone provides latitude and longitude
coordinates of the location.
ix
Chapter1
Introduction
1
1.1 Introduction
The aim to design and develop the project is to produce a tourist
guide for Skardu city to facilitate domestic and international
tourists.Due to unavailability of proper tourist guide tourist
face many problems.As traditional practice when a tourist vis-
its Skardu they have to engage professional tourist guides. The
guides provide information about the city. We have to spend
handsome amount of money to get such services of a profes-
sional guide. It is expensive for most of the tourists. Mostly
guides are not professional because they working part time in
summer season as guide and in winter they used to work in some
other fields. So sometimes the guide also could not give proper
information to the travelers because of human nature they can-
not remembers facts and figures which is required for decision
making like temperature, heights from sea level, weather con-
dition, dates and historical importance etc. This tourist guide
can show the map of the desired location, calculate distance be-
tween two locations and shows basic information of tourist spot
using android based smartphone.It is freely available any time
whenever a tourist need.
This tourist guide project is an Android application which
uses Google map API , global positioning system (GPS) and
Internet . The system takes latitude and longitude of the loca-
tion and shows the location on map. It also calculates distance
from user’s current location to desired location. The application
will help to provide modern technology for tourism industry and
helps to boost the tourism.
A little glimpse of the key features which benefits form the
2
proposed Skardu tourist guide system are as follows:
• Reliable guide :
The tourist could use printed maps and hire a guide but
it is not fulfills the tourist needs. By using smartphones
features such as global positioning system and Internet we
can use reliable and interactive maps of the area .The ap-
plication provides reliable and accurate data which helps in
decision making.
• Efficiency:
Due to its limited portability use laptops or personal
computers (PC) is difficult. In place of laptops the appli-
cation uses smartphones for efficiency and portability.
• Profit:
The tourist guide application is freely available and sup-
ports almost all android phones so it saves the money which
a tourist spent on hiring a professional guide.Even we can
use it in smart watches shown in figure 2.1
1.2 Problem statement
To create an android application which will give services to a
tourist.A tourist needs modern technologies which can serves for
them.So the android application should be easy to use and effi-
cient to manage the traveling activities. Due to unavailability of
such application tourists are facing problems while traveling to
Skardu.They have to pay handsome amount of traveling budget
to local guides and agents to get information.
The proper tourist guide is not available which could detect
a current location, calculate distance and provide proper guide-
lines using polylines. Different problems are arise while a tourist
3
travel to a tourist spot like Skardu which we can address by
development of the system which will provide accurate global
positioning system (GPS) coordinates, provide proper real time
direction, textual and pictorial information about the location.
A concise explanation of some of the major challenges are given
below:
1.3 Objectives
• The aim to design and develop the project is to produce
a tourist guide for Skardu city, the application is to be
user friendly tourist guide over android operating system
for Skardu city which is not available currently for smart-
phones. Due to domestic and international tourist flow in
Skardu city such application is helpful for the tourists.Nowadays
people prefer to use android application due to easy, con-
veyance usage.
• To change the traditional techniques of human guides by us-
ing printed maps and written information. The traditional
technique might create problems while decision making due
to lack of information of guide. Because in Skardu only in
summer people working as guide.
• To avoid getting services from people which we need to
engage as guides.The application serves as virtual guide to
facilitate to a tourist with interactive Google Maps.
• To provide location base services for tourist using GPS co-
ordinates.
• To calculate distance between current locations to desired
location.
4
• To provide basic information about the tourist spots.
• To facilitate tourism industry by using modern technologies
to boost tourism.
• To make available desired direction services and compass
for right direction.
1.4 Limitation and Scope
1.4.1 Scope
• It supports almost 90% android phones as shown in table
(Figure 3.3)
• After searching a location using Internet we can use that
location data off-line.
• It can be use without sign-up
1.4.2 Limitation
• It required a device (smartphone) which should have in-
stalled android operating System.
• It could only locate the locations which the developer marked
on the map by custom markers
• Internet, global positioning system (GPS) and cellular data
required continuously.
• It cannot be run on personal computers without any virtual
device.
5
1.5 Outline of the thesis
In this chapter it consists of introduction to project, problem
statement, objective, scope and limitation of the tourist guide.
In chapter 2 describes existing mobile and android city tourist
guides. It also includes android application development using
Google maps API, location based sensing technologies, global
positioning system and android studio. Finally introduces algo-
rithms used while development of such technologies.
This chapter 3 includes methodology , android architecture,
android life cycle, Skardu city guide architecture and project
contribution.
The chapter 4 introduces experimental results which have
performed using smartphone.
The chapter conclusion and further work shows the achieve-
ment of the project, and the things needed to be improved.
6
Chapter2
Literature Review
7
The chapter has been discussed the features of tourist guide
styles and examined various existing application for finding places,
distance calculation and other functionalities.
2.1 Static Map Approaches
Some application providing information using static maps. These
maps are not interactive so the user could not find real location
based services. The user need interactive maps instead of static
maps for proper guidance.
There are many map application which shows the data in the
following formats:
• Textual information
• Pictorial information
• Static maps
• Graphs
• Tables
2.1.1 Personal Activity Travel Surveys
Abdulazim et al. [1] presented a data collection framework and
its prototype application for personal activitytravel survys by
the use of modern smartphone’s latest sensors. The main pair of
the framework run on smartphones backed by cloud based (on-
line) services for data storage, information distribution, and de-
cision making support. The structure consist machine-learning
methods to get automatically activity kind and travel ways with
min disturbance for the receiver. Wang et al. has discussed the
importance of smartphone positioning data as an another data
8
Figure 2.1: Find a Location using GPS based Android Smart Watch
source for travel behavior studies. The study is particularly in-
terested in its potential for analyses in travel behavior dynamics.
The authors discussed the relative advantages of mobile posi-
tioning over travel diary/ GPS tracking as an alternative data
collection technique. Eventually, they concluded that smart-
phone positioning info is a important data source for study the
behavior of travelers. [1]
2.1.2 The Services Based on Location
The Services Based on Location gives a customized option to
client situated in a situation from geographic location informa-
tion of provided by database. This facility uses geographic in-
formation systems ,this kind of information can be obtain from
customer side, as GPS, or server side, as positioning service
accommodated for the cellular network operator, and commu-
nication tech of system to transmit info to an application that
can process and answer the requested service.[2]
9
2.1.3 Security
Android architecture is secure and softwares of Android are
coded with the computer programming languages Java, XML
with the Software Development Kit (SDK) tools of Android the
code is compiled into an Android package kit (.apk), this bundle
may be use in Android devices. The operating system consider
every application like a novel Linux client, every application
keeps running in its own procedure, which will run in isolation
from another.[2]
2.2 Challenges
The challenge solved by mobile was capability to obtain exact
place from the desired location, user’s location map, calculating
distance between two places, forecast the weather condition ,
find the multimedia information. Research reveals that many
software have been created, but the specific information which
a tourist need mainly fetch from the newspapers,advertisements
and magazines these sources do not give accurate information
when tourist on traveling. [3]
2.3 Existing Solutions
keeping in mind these issues many applications have been rec-
ommended by different authors during last decade to effectively
and efficiently control the tourism industry by giving different
solutions.
• Islamabad City Guide is one of the city guides. It does
not use Google maps and GPS (Global Positioning System)
it uses static maps and pictures to show the places. It does
not provide location base services.[4]
10
• Smart Tourist Guide provided the guide layout and
implemented the guide as mobile application namely smart
travel guide, the mobile phone users can search for tourism
related guidance as per their needs. using smart travel
guide, travelers can get an attraction’s concise information,
like textual, pictorial and video. Specially, the smart travel
guide is able to give information to the travelers about a
location, which can be accessed using a map. Traveler can
find the close by places and visit the place after calculating
the distance between the traveler’s location and the tourist
spot. As they moves the application updates the user’s
position on the map.[3]
• BE-ON-THE-ROAD kind of softwares mainly provides
navigational services. An application which provides this
feature is BE-ON-THE-ROAD. It uses Google maps but
its interface is not user friendly and does not provide writ-
ten and pictorial information about the location. Another
Guide namely Navigation shows all routes of major cities on
the basis of GPS coordinates. In the proposed project the
user easily use this feature and the interface is user friendly
• BRouter is also provide navigational services.But the dif-
ficulty with this application is that every time when we start
the application it request for download the map to device.
Which could not be the recommended method to provide
navigational services to a tourist. So in my propose project
solves this issue by providing direct access to the map.
• GPS Route finder is a good application to find distances
between two locations and it calculation but it does not
11
provide any other services expect the distances calculations.
This feature is also include in the proposed project.
12
Figure 2.2: Global Positioning System (GPS ) with 4 satellite connected out of 24
GPS has its importance in transport and carriage system
around the world. It gives correct site information for as many
of people as in the world. GPS satellites sends signals from
sky which are receive by the receivers, their could be a single
receiver or built-in to a device which the receives.It provides with
3D information: altitude, latitude,and longitude.If the client
device capable of a G.P.S(Global Positioning System) which is
necessarily include into modern smatphones, the user’s location
can easily and accurately be locate.[5]
13
Figure 2.3: Google Maps
2.4 Use of Google Map API
The following tasks which are important to accomplish using
the Google Maps API efficiently:
• To show directions from point A to point B.
• To place a marker on map based on GPS coordinates.
• Place multiple markers based on the data retrieved from
the GPS.
• Add layers (such as the traffic layer).
• Fit the map to the bounds.
14
2.5 Location Detection
The globle positioning system (GPS) is a navigation system
component consist of a network of 24 (as shown in figure 2.2)
outer earth satellites moving into an orbit launched by the
American defense department. Initially GPS was used by the
army in different applications, but in the 1980s, they announced
that now may use by general public.21 dedicated GPS satellites
and 3 spare satellites are rotating around the earth at an alti-
tude of about 10,600 miles. The satellites are set in such a way
that four satellites still over the sphere, from any point on the
earth. Each of the satellites has an atomic clock, a radio and
a customized computer. The satellites continuously send their
location information and time readings. At least once in a day,
each satellite confirms its location and time with a earth sta-
tion,to check any minor error in the broad casted information.[6]
Location detection is a basic part of this software which in-
clude sensing the location on map. For classification it uses
Latitude and longitude coordinates.It is necessary to discover
the correct location of the device on the maps. Location discov-
ery is a straightforward and fast method to identify the device
location on a map. Each position has a distinct number latitude
and longitude, it could be use this information to detect the lo-
cation/region on a map.Primary and important reason to utilize
this method is that use of global positioning system (GPS) is a
around the globe and free facility.
The accuracy of device is approximately within 10 meters and
it is usually sufficient to find the location of the GPS device.
The software automatically discover and point the location on
Google maps which is already integrated with this application
15
as shown in figure 2.1.
2.6 Calculate Distance Between two Locations
During literature review the fact revealed that in past years
many algorithms have been created for navigate(routing) be-
tween two points. However here we will discuss two popular
algorithms the Dijkstra’s algorithm and the havarsine formula.
The ’havarsine’ formulae works good to manipulate the distance
by direct point to point.It could be shortest path over the earth’s
surface. Sometimes it is called crow fly distance among the
points (it ignores the turning points, ups and downs). So the
selection of algorithm will be as per our need. Brief introduction
of both algorithm is presented below
Dijkstra’s algorithm:
Computer science professional Dijkstra, created Dijkstra’s al-
16
gorithm in 1956 and it printed for public in 1959, it was a
graph searched based algorithm that can resolve the one starting
point shortest path issue of a positive graph, showing a short-
est path tree. The method is mostly useful while searching a
path. A starting node in the graph, this method calculates the
path which is shortest path between that node and other nodes
as shown in figure 2.4. Using this method we can also calcu-
late the costs of single node to single target node for shortest
path. For this we have to break the algorithm once it is estab-
lish the shortest path to target node. As example, if the node
in graph it shows multiple places/cities and corners shows the
walking/driving distances among the places in pairs by line as
road, this algorithmic method could be utilize to find the short-
est route between a city and other all cities.We get the result
that shortest path first is generally used in networking as rout-
ing/searching protocols, most prominently ( I.S Intermediate
System and I.S Intermediate System) and open shortest path
first).[7]
17
Figure 2.4: Example image for the following Dijkstra’s algorithm’s Analysis
The Dijkstra Algorithm is being used to process diagram :
While going into detail parts of the algorithmic-code it is nec-
essary to know that the functions of algorithm. Djkstra’s Algo
meets expectations to solve the sub-part m, which processes
the briefest way from the source to nodes among the m nearest
nodes to the source. To make the djkstra’s Algorithm function
it need to be coordinated weighted diagram and the edges ought
to be positive. If the corners are not positive it is not possible
to obtain shortest path.
At the mth location, it will be a set which called Fron-
tier/boundary of m node that could exits the nodes nearest
to the start and the nodes that lie outer frontier/boundary are
calculated and give into new frontier/boundary. The minimum
distance attain is maintained in sDistanc[x]. It can hold the
approximate distance from s to x. Dijkstras algo locate the next
nearest vertex by maintaining the new frontier/boundary/boundary
vertexes in a priority minimum queue.[8]
The algorithm finds the shortest distance of vertex d from
18
19
the start point in the array, sDistanc. The smallest point of the
start to itself is zero. sDistanc for all other nodes is set to unlim-
ited to present that the nodes are still not developed. When the
algo complete the working of the nodes sDistanc shall have the
shortest path(distance) of node x to s. 2 sets are keep on bound-
ary and new boundary which boost in the working of the algo.
Frontier/boundary has m nodes which are nearest to the start-
ing point, will have previously calculated shortest distances to
these nodes, for the path limited up to m nodes. The nodes that
exists outer of Frontier is set called new frontier/boundary.[8]
2.6.1 Disjkstra’s Algorithmic-Code
The Disjkstra’s Algorithmic-Code is as under The following al-
gorithmic code gives a concise explanation of the functions of
the Dijkstras algorithm. Procedure Djsktra (V: set of nodes 1...
h node 1 is the source Adjc[1h] of adjacency lists;
EdegeCostCalc(u, x): edge cost functions;)
Var: sDistanc[1h] of path costs of source (vertex 1); sDistanc[j]
shortest path’s length will be will be equivalent to j
Begin:
Initialize
make a set Frontier which is virtual to save i here sDistanc[i] is
already completely resolved
Create priority queue(empty) new frontier/boundary; sDistanc[1]←0; The distance to the source is zero
for all nodes x in V 1 do no node have been explored yet
sDistanc[x]← infinity
end for;
Fill new frontier/boundary with nodes x in V organized by pri-
orities sDistanc[x];
endInitialize;
20
repeat
d← DeleteMini new boundary; d is the new nearest; sDistanc[d]
is already correct forall of the neighbors x in Adjc[d] do
if sDistanc[x] . sDistanc[d] + EdegeCostCalc(d,x) then
sDistanc[x] ← sDistanc[d] + EdegeCostCalc(d,x)
updte x in new boundary by new priority sDistanc[x]
endif
endfor
till new boundary is empty
endDjkstra; [8]
Best first and breadth first search shows by this algorithm.The
best nodes is new boundary which is selected for next process
so it is best first. This search apply breadth first, since new
frontier/boundary consists of nodes that we can be check next
and nodes are one edge far from the searched nodes.[8]
Nowadays people prefer to use smartphones due to its easy
to use and handy nature.It is also capable of running various
applications at one smarthphone. So naturally the applications
related to tourism helps to navigate , find distances and pro-
vide informations about desired locations.Even the conventional
maps which are printed on papers are still generally in use, but
nowadays google maps based websites and application are be-
came more popular because of its usefulness, accuracy and rich
content. [9]
21
Chapter3
Methodology
22
The proposed project uses Google Maps APIs for finding a
location , calculate distance between two places and showing
information about a location.
3.1 Android Architecture
The Android operating system composed of five main layers
as shown in figure 3.1. These layers included Application, li-
braries of different nature, Kernal of Linux which is core of OS,
framework of application and the last is runtime android. Top
level layer is called android application layer in any android sys-
tem.Here we can find some important feathers like short mes-
saging service applications, electronic mail applications, calls,
calenders, browsers , maps, contacts. Java is main language to
develop these components.
Framework of application is the next and second layer of an-
droid architecture. This is outline or framework which uses by
software application developers. Application programming in-
terfaces are available for development purposes.it consist of basic
tools and use to create more complex applications in android.
23
Figure 3.1: Android Architecture Reprinted from androidhavies.com
24
The layer which is use by different Android system compo-
nents. Developers fallow the available libraries in framework of
Application. Developer use these libraries for common tasks or
reuse system functions for their own purpose. The layer four of
this architecture is the Android Runtime. Dalvik virtual ma-
chine is use by android as Java uses virtual machine to provide
environment to application on runtime.It is a special software
which create new processes independently for android applica-
tion.
Linux kernel is the last and fifth layer in android architec-
ture.Linux kernel’s Linux version 2.6 is use by the android. It
is used for memory management, power management software,
file system access, networking, inter process communication, se-
curity settings and several drivers for hardware. The Kernel
hides the hardware from the user of software.
3.2 Life Cycle of Android Application
An Activity in Android can exist in four states as described
below: In android an activity could be use in four states as
written and shown in figure 3.2
3.2.1 Active and Running state
In this state the activity runs in front and shows focus on it.It
user uses actively and observable completely.
3.2.2 Paused state
In this state, the program is partly observable to the user but
it is not visible to user and unfocused. This happen when some
other activity is running which doesn’t cover up the whole screen
or having some clearness so that the partly visible activity is
25
Figure 3.2: Android Application Life Cycle reprinted from strawflower.com
original Activity. The activity which paused activity is entirely
alive and keeps its state but it can be stop by task manager
where we have an option to clear currently running applications.
3.2.3 Stopped state
When the main screen not showing the activity is called stopped
state.It completely unclear the view and running another activ-
ity. In this stopped state also the activity running in background
and uses resources like memory etc, but it can be stop by task
manager where we have an option to clear currently running
applications.
3.2.4 Destroyed/Dead state
When a running application is no more in memory called a
dead/destroyed state.May be the application is not started or
after starting the application is cleared from memory to save
memory resources. The figure 3.2 below shows the android ac-
tivity life cycle flow chart. It need be studied by the developers
as its an important state. Life cycle of an android application
can be shown as under.
26
The above Life cycle of an android application flow figure can
be explained as under:
• On starting of an Activity in Android smartphone, it calls
the onCreate() function.In this time it initializes the data
essentials and creates User Interface.
• onStart() function is called even user have not seen the
activity yet. The activity is still stopped so we should know
why.
• With the onResume() function, user can interact with activ-
ity and can see it on screen. In activity stack the position
of activity will be at the top. Now the application is in
running state and inputs can receives from the user.
• when it is in the Active state, onPause() function could be
accessed the application is ready to resume when the user
presses the home button or one other activity is running on
the top of this one.
• One activity or notification is on top of it doesn’t totally
unclear the visibility of actual activity. The smartphone
goes to sleep.
The activity could goes to paused state in below three con-
ditions: The user resumes the Activity by closing the new
Activity or notification and the paused Activity gets Ac-
tive/Runs as calling onResume() functions. If the battery
is totally low condition then it gets killed . then it is not
possible to call any other functions before destroying the
Activity and it required to be run again from the starting
by getting onCreate() and restoring the last configuration
from the bundle object. Otherwise it calls onStop() func-
tion to move it to stop state.When the user presses back
27
button this action is performed by default. or it resumes
on the top by totally covering by a new activity.
• In stopped state there could be three distinct cases as under:
To free the memory resources the OS could kill: An activity
under stopped sate is more probably to be clear from the
memory by the system than one in the paused state. It
needs to start the restart again with onCreate(). It get start
again by calling onRestart() , onStart() and onResume()
functions properly if the user presses back button to the
Activity again. In this scenario, the User Interface is on
its place and it is not necessary to restart. onDestroy()
funtion is called and the Activity is dead/destroyed. This
is the final function we can call before the Activity is dead.
This happen in two cases: 1. The Activity is completed the
its job. 2. The application is temporarily cleated to save
the memory space..
3.3 Android Versions and Its latest comparison
An important aspect of Android operating system is its differ-
ent versions. These version are improving and providing new
services to users. As the smartphones’ hardware improving and
capable to provide more services the Android operating system
also side by side improves itself. The latest usage comparison is
as under.
28
Figure 3.3: Android Versions and Its latest comparison (Picture Reprinted from Phon-Driod.com)
29
3.4 Project Contribution
The actual contribution by this project is to show a comprehen-
sive understanding and realization of city guide on the android
operating system as new developmental platform. Now we can
see many examples of city guide on other platforms such as Win-
dows Mobile, IPhone etc. However, there are no any city guides
for Skardu city. This project encapsulated basic features of city
guide such as showing Google maps, locating user”s location,
getting information of tourist spots, basic information, showing
different routes by directions, and choose off-line information
about different facilitates like hospitals, shopping centers, car
rentals, checking about the latest weather conditions, keep in
touch on social networking and looking for nearby places on the
map.This project have six main parts as under
3.4.1 Direction
This activity fetch Google maps and give the user opportunity
to select location and find distances among the places.It uses
Google’s direction API to complete this tasks. It also shows
source to destination path of tourist by drawing lines. It can
calculate the distances in kilometers as shown in figure 3.4 . It
also shows users current location by using GPS coordinates.It
requires Internet and GPS enabled.
3.4.2 Locations
Its an important part of this application which shows location
in Skardu city like hospitals, car rentals , pharmacies, shop-
ping center, and many other location offline. It shows phone
numbers, addresses , email(if available) and website addresses(if
available) as shown in figure 3.5.
30
Figure 3.4: Showing location with time and distance
31
Figure 3.5: Shows locations activity and detail activity
32
3.4.3 Nearby Places
Google have its another important API called Google places
API which detects current coordinates of tourist and according
to its location shows nearby places it helps users to locate nearby
places as shown in figure 3.6.
3.4.4 Weather
This part can show to the tourist latest weather updates. It
shows hourly, daily and weekly weather forecast to facilitate
the user of this guide as shown in figure 3.7.
3.4.5 Social Networking
Nowadays the role of social networking is obvious, so this part
connects the tourists with a special group page on facebook as
shown in figure 3.8.Where they can discuss about tourism and
share their experiences while traveling to Skardu.
3.4.6 Map Marker Information
This option shows the map and customize markers which shows
the required information about a location.A picture and some
text briefly describes a location on the map as shown in figure
3.9.
3.5 Fundamentals of Application
This component of application shows key aspects of application
development. It consists of four parts.Services, receivers, con-
tent providers, activity and broadcast. An android application
may contain one or many of these components types.
• Activity shows interfaces for user that the users will use
it for communication. i.e, in short messaging component,
33
Figure 3.6: Shows multiple nearby places
34
Figure 3.7: Shows weather forecast activity with details
35
Figure 3.8: Shows social networking group page
36
Figure 3.9: Shows customize markers on map
37
one activity shows the user interface to users for writing a
short message to others. activities are entirely written by
extending Activity main( base) class.
• Services do not run in background and user interface is
not exits. i,e, if we play a music in background. Service
extends Service base class.
• Broadcast Receivers this part receives and give reaction
to broadcast announcements. i.e, if it shows the battery is
low, it necessary to convey this message to mobile users.
The receivers extend Broadcast Receiver base class.
• Content Provider this part provides data and stores
it. It extends Content Provider base class but applications
do not call directly to the methods in Content Provider,
in place of this they call methods in the object Content
Resolver, which call Content Provider.
The following technique is used by android for retrieving
and storing the data.Network, database, files and prefer-
ences
The Android API contains support for creating and using
SQLite databases. Each database is private to the applica-
tion that creates it. The SQLiteDatabase object represents
a database and has methods for interacting with it by cre-
ating the database, making queries and managing the data.
3.6 Skardu City Guide Application Architecture
Skardu City Tourist Guide is working as the following archi-
tecture. It starts with a splash screen which shows its name
and profile picture. After that a menu will appear where a user
can select different locations like tourist spots, market , schools,
38
hospital etc. The system checks the Internet connection and
provide the map for that location.It is shown in figure 3.10
39
Figure 3.10: Skardu City Guide Application Architecture
40
Figure 3.11: Skardu City Tourist Guide Application Main Menu
41
3.7 Showing Distance Between Two Locations by
Drawing Polylines
On the basis of latitude and longitude we can calculate distance
between two points. A polyline will be draw when user selects
source and destination as shown in figure 3.12. Usually the
device location will be the source location which the application
will detects and shows on map. However we can change both
source and destination locations.
42
Figure 3.12: Distance Between two Location with time and kilometer
43
Figure 3.13: Main map of Skardu
44
Figure 3.14: Distance Between two Location by Drawing Polylines
45
3.8 Development of Software
The development of Software is start with a software process.
The software model shows how a developer can develop a soft-
ware and which approach is better to develop a particular soft-
ware application. The model which I have selected is Rapid
Application Development (RAD) model. The main reason to se-
lect the model is that the RAD model not emphasis on planning
tasks and emphasis on application development. It is flexible
model.In other models like water fall is rigid and it is necessary
to know detailed plan about the software development. I was
new in the Android Software Development so I was blank about
to develop this application. In this model we can built proto-
type of software demonstrates it , refine it untill the required
application goals meet. Then we deploy it.
3.9 Summary of Guide
All the snap shots and other details shows the activities, along
with the navigational and location based services given to the
user. The icons shows different links to the application’s func-
tionality of the Skardu city tourist guide. The first activity
provide a user main menu where they can choose different op-
tions. The other activities would result in the listing of the said
functionalities on the location and coordinate basis which the
user has requested for and also the they can fulfill their guidance
needs by giving the criteria. The application provide different
kinds of information for tourist like Markers information , Im-
ages, Maps, and text information in their smartphones.
46
Chapter4
Experimental Results
47
Figure 4.1: Skardu City Guide Splash Screen48
4.1 Starting of Application on Android Smartphone
The application successfully run on Samsung Galaxy Tab 3 and
operating system was Android version Kit Kat 4.4.2.The first
screen which the application showed was splash screen(as shown
in figure 4.1) for four seconds which is set during development
of splash screen. After that it showed the main menu consist of
click able buttons.
4.1.1 Location Based Services
The Application has three main components it shows Direc-
tions, find distance between two locations and locate famous
places. The screen shots showing the these functionalities be-
low. Custom markers are showing the location with both text
and pictorial information. The location can be find by clicking
on marker , writing the name of place on the location search
text box and giving GPS coordinates. These experiments have
done on real device instead of emulator. The results successfully
showed the location and gave required result.
49
Figure 4.2: A marker is showing view of jinnah park and other customize markers
50
4.1.2 Direction Between two Places
At next step the experiment is checking the direction interface
and it successfully showed direction between two cities Skardu
city and Gilgit city by drawing polyline on the map. It used
Hussainabad Skardu GPS coordinates as my location which can
be select by pressing default button on the map and destination
as Mashbrum tours Gilgit. It showed travel time between the
cities as well as distance in Kilo meters. The following screen
shot showing this in detail:
51
Figure 4.3: Direction showing by drawing polyline on the Map between to CitiesSkardu and Gilgit
52
4.2 Location on Map by Markers
The markers show the location prominently and user can easily
locate the desired place.It also shows picture and brief informa-
tion about location. It shows customs text and images setup
by the developer. The default markers could not show detailed
city information but using custom marker we can feed any in-
formation according to need of the user.
4.3 Weather forecasting and social networking
These both modules are working properly and shows required
information.
4.4 Location
This module shows offline information i.e name, address , phone
no etc about important location properly.
53
Chapter5
Conclusion and FutureEnhancements
54
5.1 Conclusion
The tourist guide application is an important tool for a traveler.
Most of the traditional methods are time consuming and re-
quired skilled human resources who suppose to guide the tourist
in field. The main purpose of the proposed project is to ensur-
ing to save the time of tourist, provide proper guidance and
directions to the tourist.
The tourist guide system provides an easy to use menu where
user can select different buttons according their needs . The se-
lects directions , locations , distances and some other options
according to their needs. The user can use these services using
Internet , Global Positioning Systems (GPS) and Google maps.
The Google maps are interactive so the user easily locate the
places and the map draws a line to show proper direction. These
lines helps to reach the destination. The user can also get latest
weather forecast information of Skardu city.
This tourist guide uses latest maps which can display loca-
tions on the basis of latitude and longitude provided by users.
5.2 Future Enhancements
• Adding Google Street view
The proposed system shows pictures and images of a
location but we can show three dimensional images of the
place using Google Street view map API. It helps the user
a to see the location on every angle. Which is definitely
helpful to make any decision regarding that location and
clear visualization of the location.
• Off Line version
55
In future the proposed system could be converted into
off line version. Then this guide will be more helpful for the
tourist who do not have access to Internet facility. Making it
off line will increase its storage but it could be compromised
as the tourist will bet more benefits.
I hope that this project will helpful for other students and
developers to understand Android programming , Java language
and XML. In their research they will use Android application
development and they will use it and make more enhancements
in future research by identifying more research topics in these
directions.
56
Bibliography
[1] Y Liu, Y Hu, and X Li. A smartphone-based prototype
system for incident/work zone management driven by crowd-
sourced data. Digital Repository Iowa State University,
2(2), 2015.
[2] S Muzumil. Fastfinder android application. A The-
sis Presented to the Department of Software Engineer-
ing Mehran University of Engineering & Technology,
Jamshore, 2(2), 2014.
[3] Jinendra, D Bhagyashri, and A Pranav. Smart travel guide.
1st International Conference on Recent Trends in Engi-
neering & Technology,, 2012.
[4] Umair Ahmed. Pakistan travel guide.
http://intellisenseglobal.com/, December 2014.
[5] N Xu J Meng. A mobile tourist guide system based on
mashup technology. IEEE, 2010.
[6] S Garmin. What is gps? Wikipedia, 2015.
[7] A Rosetta. Dijkstra’s algorithm. rosettacode.org, 2015.
[8] M Puthuparampil. Report dijkstra’s algorithm. Technical
report, New York University, 2007.
[9] L Storm. Disadvantages & advantages of using google maps
website. http://science.opposingviews.com/, 2001.
57