Mobile Applications
Chapter 6
BY
MR. A. B. MOMIN
ASSISTANT PROFESSOR
DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING
ATS’S, SANJAY BHOKARE GROUP OF INSTITUTES, MIRAJ
Geolocation and Maps
Mobile Applications Mr. A. B. Momin, Assistant Professor, Department of CSE
Location Techniques
There are different techniques that we can use to determine the geographical location of a
device, based on the platform, the browser, the operator, and so on.
• Accuracy
Every location technology has some accuracy error. This is usually specified in a distance
metric, like meters or kilometres, but in some techniques accuracy is defined according to
levels, such as city accuracy or country accuracy.
• Indoor Location
The idea is that we can offer better services for the users inside the building if we can
pinpoint what floor they are on or what department they are in. These services may be local
services on the Internet, or even services provided on an intranet with the user using a
Wireless LAN connection.
Client Techniques
Mobile Applications Mr. A. B. Momin, Assistant Professor, Department of CSE
• GPS
The Global Positioning System (GPS) is the first technique most people think of when location detection
is mentioned. The United States government created GPS as a system for locating devices, using
between 24 and 32 satellites orbiting the Earth.
• A - GPS
Assisted GPS (A-GPS) is a software-based system available for mobile phones connected to carrier
networks that can help the devices to determine their locations.
• Cell Information
Using the operator network’s cellular towers, the carrier can triangulate the position of a mobile device.
The accuracy will depend on how many cell towers are in range.
• WIFI Positioning System
The WIFI Positioning System (WPS) is a very clever technique that detects your location using the list of
wireless routers that are available in your area. This method relies on a pre-existing database of routers
and their geographical locations.
Server Techniques
Mobile Applications Mr. A. B. Momin, Assistant Professor, Department of CSE
• IP Address
The main server technique for locating a user is reading the client’s IP address. IP address we receive
may be the operator’s WAP gateway address, a dynamic IP address in the operator’s range, or the IP
address of the WIFI connection.
• Carrier Connection
Some worldwide operators offer developer programs (both open and private) for web portals that allow
any request made from a user to your web server to carry additional headers containing information
about the user (identity, location, and billing services).
Detecting the Location
Mobile Applications Mr. A. B. Momin, Assistant Professor, Department of CSE
There are two options for detecting the user’s geographical location: using the W3C Geolocation API,
available under the HTML5 APIs, or using third-party APIs, usually available directly from carriers.
• The W3C Geolocation API
The W3C standard way to query the user’s position from JavaScript is called the Geolocation
API. The Geolocation API doesn’t rely on one location technology.
1. Getting the Position
The first way to use the Geolocation API is to get the user’s location using the getCur
rentPosition() function of the geolocation object.
The coordinates property has the following attributes, defined in the W3C standard:
• latitude in decimal degrees
• longitude in decimal degrees
• altitude (optional) in meters above the ellipsoid
• accuracy in meters
• altitudeAccuracy (optional) in meters
• heading (optional) in degrees clockwise related to true north
• speed (optional) in meters per second
Google Map
Mobile Applications Mr. A. B. Momin, Assistant Professor, Department of CSE
To invoke the Google Maps application on Android devices we can just point to
maps.google.com and optionally send any parameters we want to include, in the basic form
http://maps.google.com/?<attributes>. Attributes should be URL-formatted, as in
attribute1=value1&attribute2=value2.
Possible attributes include:
• Q: Query parameter; this can be a comma-separated coordinate preceded by a loc: prefix
(loc:lat,long)
• Near: Applies a location definition for a query, as in q=starbucks;near=san+mateo+ca
• LL: A comma-separated latitude and longitude for the map center.
• T: The type of map (m: map, k: satellite, h: hybrid, p: terrain).
• Z: The zoom level, from 1 (the whole world) to 23.

Mobile applications chapter 6

  • 1.
    Mobile Applications Chapter 6 BY MR.A. B. MOMIN ASSISTANT PROFESSOR DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING ATS’S, SANJAY BHOKARE GROUP OF INSTITUTES, MIRAJ
  • 2.
    Geolocation and Maps MobileApplications Mr. A. B. Momin, Assistant Professor, Department of CSE Location Techniques There are different techniques that we can use to determine the geographical location of a device, based on the platform, the browser, the operator, and so on. • Accuracy Every location technology has some accuracy error. This is usually specified in a distance metric, like meters or kilometres, but in some techniques accuracy is defined according to levels, such as city accuracy or country accuracy. • Indoor Location The idea is that we can offer better services for the users inside the building if we can pinpoint what floor they are on or what department they are in. These services may be local services on the Internet, or even services provided on an intranet with the user using a Wireless LAN connection.
  • 3.
    Client Techniques Mobile ApplicationsMr. A. B. Momin, Assistant Professor, Department of CSE • GPS The Global Positioning System (GPS) is the first technique most people think of when location detection is mentioned. The United States government created GPS as a system for locating devices, using between 24 and 32 satellites orbiting the Earth. • A - GPS Assisted GPS (A-GPS) is a software-based system available for mobile phones connected to carrier networks that can help the devices to determine their locations. • Cell Information Using the operator network’s cellular towers, the carrier can triangulate the position of a mobile device. The accuracy will depend on how many cell towers are in range. • WIFI Positioning System The WIFI Positioning System (WPS) is a very clever technique that detects your location using the list of wireless routers that are available in your area. This method relies on a pre-existing database of routers and their geographical locations.
  • 4.
    Server Techniques Mobile ApplicationsMr. A. B. Momin, Assistant Professor, Department of CSE • IP Address The main server technique for locating a user is reading the client’s IP address. IP address we receive may be the operator’s WAP gateway address, a dynamic IP address in the operator’s range, or the IP address of the WIFI connection. • Carrier Connection Some worldwide operators offer developer programs (both open and private) for web portals that allow any request made from a user to your web server to carry additional headers containing information about the user (identity, location, and billing services).
  • 5.
    Detecting the Location MobileApplications Mr. A. B. Momin, Assistant Professor, Department of CSE There are two options for detecting the user’s geographical location: using the W3C Geolocation API, available under the HTML5 APIs, or using third-party APIs, usually available directly from carriers. • The W3C Geolocation API The W3C standard way to query the user’s position from JavaScript is called the Geolocation API. The Geolocation API doesn’t rely on one location technology. 1. Getting the Position The first way to use the Geolocation API is to get the user’s location using the getCur rentPosition() function of the geolocation object. The coordinates property has the following attributes, defined in the W3C standard: • latitude in decimal degrees • longitude in decimal degrees • altitude (optional) in meters above the ellipsoid • accuracy in meters • altitudeAccuracy (optional) in meters • heading (optional) in degrees clockwise related to true north • speed (optional) in meters per second
  • 6.
    Google Map Mobile ApplicationsMr. A. B. Momin, Assistant Professor, Department of CSE To invoke the Google Maps application on Android devices we can just point to maps.google.com and optionally send any parameters we want to include, in the basic form http://maps.google.com/?<attributes>. Attributes should be URL-formatted, as in attribute1=value1&attribute2=value2. Possible attributes include: • Q: Query parameter; this can be a comma-separated coordinate preceded by a loc: prefix (loc:lat,long) • Near: Applies a location definition for a query, as in q=starbucks;near=san+mateo+ca • LL: A comma-separated latitude and longitude for the map center. • T: The type of map (m: map, k: satellite, h: hybrid, p: terrain). • Z: The zoom level, from 1 (the whole world) to 23.