Java Reference
In-Depth Information
a circle in which the device is likely to be. It's important to remember when designing
your application that the position data is approximate—even taking into account the
position circle. It's possible for a device to fall outside the positioning circle, although in
practice this doesn't happen often. This positioning error is often referred to as the
uncertainty of position, and in some systems, you can trade position uncertainty for
other factors, such as the amount of time or financial cost involved in determining the
device's position. Depending on device and network capabilities, position information
may also be accompanied by the device's elevation, speed, and course (direction of
motion), although that isn't always available.
Due to the nature of the positioning systems themselves, obtaining device position
is an expensive operation from the perspective of battery power, time, and user cost.
Positioning can require scarce device resources as well as network transactions with
remote servers, so devices provide position data in near-real time, rather than real time.
Introducing the Location API
The Java ME Location API defines the javax.microedition.location package, which
contains a collection of classes that permit applications to request and obtain a location
result. The Location API was designed to work with both CLDC and CDC devices,
although it is only available for CLDC 1.1 and later devices, because the location frame-
work requires floating-point mathematics support in order to provide your application
with latitude and longitude information.
The Location API abstracts the device's location subsystem from your application,
giving you a way to determine the device's location in a manner that best meets your
application's constraints (such as position-acquisition time, uncertainty, and cost to the
user). You can request a position just once (often referred to as a one-shot positioning
request), or you can request that the API deliver notifications of device position while
your application is running.
All Location API implementations must provide the latitude and longitude coordi-
nates in a position response, along with the time at which the device determined the
position and a measure of accuracy. Depending on the device's hardware, position data
may also include the orientation (compass, pitch, and roll) of the device, the speed at
which the device is traveling, and more human-palatable data such as a position's
street address.
The Location API provides an additional feature that isn't available in most APIs
on other platforms (e.g., Qualcomm's BREW ), and that's access to a system-wide
database of landmarks and the position of those landmarks. This permits the device's
native software and all applications on the device to share a single store of common
user-specified locations, such as the positions of the user's place of residence and
occupation. This enables the user to have a consistent user experience across all LBS
applications on the device.
 
Search WWH ::




Custom Search