Location Based Services and Integration of Google Maps in Android PDF
Location Based Services and Integration of Google Maps in Android PDF
Location Based Services and Integration of Google Maps in Android PDF
in
International Journal Of Engineering And Computer Science ISSN:2319-7242
Volume 3 Issue 3 March,2014 Page No. 5072-5077
Abstract:In today’s scenario, mobile computing has advanced to such an extent where the user has access to all the information on a
single device. Today people are always moving with mobile devices like laptops, cell phones, tablets etc. Using the user’s geographic
location, a lot of information related to the user of the mobile device can be collected. The knowledge of mobile user's location can
improve the class of services and applications that can be provided to the mobile device user. These classes of applications and services
are termed as location based services. Location Based Service (LBS) is a kind of service that helps in getting the geographical location of
the user and more useful information near to the user location. This location based information can be obtained in different terms such
as position, vicinity, proximity, context, maps, routes, places etc. Our paper focuses on LBS in detail and identifies key components of
LBS for providing this service to the user on the Android platform. It also explains the use and implementation of Google Maps and its
APIs in getting various location based information on Android.
PanktiDoshi, IJECS Volume 3Issue 3March, 2014 Page No 5072-5077 Page 5072
There are two ways in which the location of a mobile device Service servers: Service servers are responsible for
can be tracked: processing service requests and sending back request results,
and these service servers are maintained by service
1. Communication Network: Communication providers. Basically these servers provide functionalities
network is the mobile network which transfers such as calculating positions, search for a route, or search
service request from user to service provider, and specific information based on user's position. Service
providers usually do not store and maintain all the
requested information back to the user. Global
information requested by users. Instead, content providers
System for Mobile communications (GSM) and are responsible for collecting and storing geographic data,
Code Division Multiple Access (CDMA) are the location-based information, and other related data. These
most common standards for mobile network and are data will be requested and processed by service servers and
currently being used by majority of mobile phones then returned to users.
globally. Mobile networks are usually controlled
and maintained by service operators who provide
connectivity for mobile users and charge them for
data and voice transmission [2].
PanktiDoshi, IJECS Volume 3Issue 3March, 2014 Page No.5072-5077 Page 5073
Collection Service can be accessed with the help of
LBS middleware, For example, mobile network
triangulation via a service provider or directly via
GPS receiver in the smartphone.
/* more criteria can be set here*/ The Google Directions API [6] is a service that calculates
directions between locations using an HTTP request.
bestProvider= Directions can be searched for several modes of
locationManagerObject.getBestProvider(criteria, true); transportation, including transit, driving, walking or cycling
[6]. To use the Directions API in an android application we
If more than one provider is available fulfilling the given need to obtain a Directions API key in the same way as we
criteria then the one with best performance is returned and obtain the Google Maps API key.
if no provider is found for the defined criteria then criteria
are loosened in order Power use, Accuracy, Ability to 5.1.1 Directions Request
return bearing, speed, and altitude[2].
A Directions API is an HTTP URL defined in the following
4.3 Location Listener: way [6]:
Arguments Description
4.4 Geocoder
Origin (required) The address or textual
latitude/longitude value from which
The Geocoder class helps in determining the geo-
we wish to calculate directions. If
coordinates (latitude, longitude) for a given address which
PanktiDoshi, IJECS Volume 3Issue 3March, 2014 Page No.5072-5077 Page 5075
address is passed as a string, the step of the leg of the
Directions service will geocode the journey
string and convert it to a distance Total distance covered
latitude/longitude coordinate to by this leg
calculate directions. If coordinates duration Total duration of this
are passed, it must be ensured that no leg
space exists between the latitude and duration_in_traffi Total duration of this
longitude values. c leg (taking into account
Destination The address or textual current traffic
(required) latitude/longitude value upto which conditions)
we wish to calculate directions. If arrival_time Estimated time of
address is passed as a string, the arrival for this leg
Directions service will geocode the (only returned for
string and convert it to a transit directions).
latitude/longitude coordinate to departure_ti Estimated time of
calculate directions. If coordinates me departure for this leg.
are passed, it must be ensured that no The departure_ti
space exists between the latitude and me is only available for
longitude values. transit directions
Sensor (required) Indicates whether or not the start_location The latitude/longitude
directions request comes from a coordinates of the
device with a location sensor. The origin of this leg
value of this argument must be end_location The latitude/longitude
either true or false. coordinates of the
Mode (optional) Specifies the mode of transport to use given destination of
when calculating directions. this leg.
Language The language in which to return start_address Human-readable
(optional) results address reflecting
Key (required) Application’s API key. The key the start_locatio
determines your application’s n of this leg.
identity.
end_address Human-readable
units (optional) Specifies the unit system to use when address reflecting
displaying results the end_location o
f this leg.
5.1.2 Direction Response Steps Each element in the steps array defines a
The direction response is returned in the format indicated by single step of the calculated directions. Step is
the output flag within the URL request's path [6]. the most atomic unit of a direction's route.
html_instructions Formatted instructions
Table 4: Direction response elements [6] for this step
Distance Distance covered by this
Elemen Description step until the next step.
ts Duration Time required to
Status Contains status of the request. May contain perform the step until
debugging information to help track down why the next step
the Directions service failed. start_location Location of the starting
Routes Contains an array of routes from the origin point of this step (single
to the destination. Routes consist of set
nested Legs and Steps. of lat and lng fields).
Legs Each element in the legs array specifies a end_location Location of the last
single leg of the journey from the origin to the point of this step (single
destination in the calculated route. set
steps[] An array of steps of lat and lng fields).
denoting information sub_steps Detailed directions for
about each separate walking or driving steps
PanktiDoshi, IJECS Volume 3Issue 3March, 2014 Page No.5072-5077 Page 5076
in transit directions
(only available 6. Conclusion
when travel_mode is
set to "transit") In this paper we probe into Location Based Services, which
transit_ Transit specific utilizes the knowledge of the geo-specific location of a
location-aware mobile device and facilitates services based
details information
on that information. We also discussed about LBS
Components and LBS Architecture. Location Based Services
5.2 Places API uses technologies like GPS, cellular network, Wi-Fi to
provide various services. Android provides various services
The Google Places API is a service that returns information to implement location based applications. Our paper
about places defined within the API as establishments, discusses APIs like Location API, Google Maps, Direction
geographic locations, or prominent points of interest using API and Places API which helps in making location-aware
HTTP requests [7]. The location within theplace requests are applications under android platform.
specified as latitude/longitude coordinates.
Today android is the most used mobile operation system in
The following Place requests are available [7]: the market. Hence developing LBS applications on android
platform can help maximum population to get the benefits of
a. Place Searches: It returns a list of Places based on this technology. Hence Location Based Services can help the
user’s location or search string along with summary users in a variety of aspects and has a greater scope of
information about each Place. Places Search consists of: development in various mobile operating system
i. Nearby Search Requests technologies like Android.
ii. Text Search Requests
iii. Radar Search Requests
References
iv. Search Responses
[1] ManavSinghal, Anupam Shukla, “Implementation
The HTTP URL of a place search request is defined in the of Location based Services in Android using GPS
following way [7]: and Web Services ”, IJCSI International Journal of
Computer Science Issues, Vol. 9, Issue 1, January
https://maps.googleapis.com/maps/api/place/search/output?ar
guments 2012.
[2] Amit Kushwaha, VineetKushwaha, “Location
Where output may be JavaScript Object Notation (JSON) or Based Services using Android Mobile Operating
XML System”, International Journal of Advances in
Engineering & Technology, Vol. 1, Issue 1, pp.14-
b. Place Details: This request return more details about the 20, Mar 2011.
indicated place such as address, phone number, etc, [3] Schwinger, W., Grin, C., Prll1, B., and
along with user reviews. When the Places service returns Retschitzegger, W. A light-weight framework for
results from a details request, it places them within a location-based services. In Lecture Notes in
single result which consists of many fields [7]. Computer Science (Berlin, 2005), Springer, pp.
206_210
The HTTP URL of aplace details request is defined in the
[4] Location-based services: architecture overview,
following form [7]:
https://maps.googleapis.com/maps/api/place/details/output?a Costas Pontikakos, Thomas Glezakos and Theodore
rguements Tsiligiridis
[5] Android Developers
Where output may be JavaScript Object Notation (JSON) or http://developer.android.com/reference/android/
XML [6] Google Directions API
PanktiDoshi, IJECS Volume 3Issue 3March, 2014 Page No.5072-5077 Page 5077