Professional Documents
Culture Documents
Introduction
• A location-based service, or LBS, is any information,
entertainment, or social media service that is
available on a mobile device, through the mobile
network and which uses information on the
geographical position of the mobile device.
Introduction
• LBS are used in a variety of contexts, such as
health, indoor object search, entertainment, work,
personal life, etc.
• Examples:
• services to identify a location of a person or object, such as
discovering the nearest banking cash machine or the
whereabouts of a friend or employee.
• parcel tracking and vehicle tracking services.
• mobile commerce when taking the form of coupons or
advertising directed at customers based on their current
location.
• personalized weather services and even location-based
games.
Reference:http://electronics.howstuffworks.com/gadgets/travel/gps1.htm
Android Location-Based Services 4
3D-Trilateration
• This same concept works in three-dimensional
space, as well, but you're dealing with spheres
instead of circles.
• For a visual explanation visit:
http://electronics.howstuffworks.com/gadgets/travel
/gps.htm
Reference : http://electronics.howstuffworks.com/gadgets/travel/gps2.htm
Android Location-Based Services 5
GPS
• The Global Positioning System (GPS) is
originally a constellation of 24 Earth-
orbiting satellites in 6 orbital planes with
4 satellites each.
• The orbits are arranged so that at any
time, anywhere on Earth, there are at
least four satellites "visible" in the sky.
• A GPS receiver's job is to locate four or
more of these satellites, figure out the
distance to each, and use this
information to deduce its own location.
• This operation is based on a simple
mathematical principle called
trilateration.
Reference: http://electronics.howstuffworks.com/gadgets/travel/gps.htm
Android Location-Based Services 6
Cell Tower Triangulation
• An alternative method to determine the
location of a cell phone is to estimate
its distance to three nearby cell towers.
• A cell phone’s signal may be picked up
by three or more cell towers, enabling
the “triangulation” to work.
• Since we know the locations of the cell
towers which receive the phone’s
signal, and we can estimate the
distance of the phone from each of
those antennae towers, based upon the
lag time between when the tower
sends a ping to the phone and receives
the answering ping back.
Reference: http://searchengineland.com/cell-phone-triangulation-accuracy-is-all-over-the-map-14790
Android Location-Based Services 7
Geographic coordinate system
• A geographic coordinate system is a coordinate system that
enables every location on the Earth to be specified by a set
of numbers or letters.
• A common choice of coordinates is latitude, longitude and
elevation.
• Latitude in GPS-Decimal notation: +90.00000 (North) to -
90.000000 (South).
• Longitude GPS-Decimal notation: +180.000000 (East) to -
180.000000 (West).
onLocationChanged(Location location)
abstract void
Called when the location has changed.
onProviderDisabled(String provider)
abstract void
Called when the provider is disabled by the user.
onProviderEnabled(String provider)
abstract void
Called when the provider is enabled by the user.
LocationManager locationManager =
(LocationManager) this.getSystemService(Context.LOCATION_SERVICE);
LocationProvider provider =
locationManager.getProvider(LocationManager.GPS_PROVIDER);
@Override
public void onLocationChanged(Location location) {
// A new location update is received. Do something useful with it.
...
}
...
};
mLocationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER,
10000, // 10-second interval.
10, // 10 meters.
listener);
Parameters
locationName - a user-supplied description of a location.
maxResults - max number of results to return.
Smaller numbers (1 to 5) are recommended.
Parameters
Latitude - the latitude a point for the search
Longitude - the longitude a point for the search
maxResults - max number of results to return.
Smaller numbers (1 to 5) are recommended.