location.get — Get location information.
The location.get command operates in two ways:
The simplest way is to simply call the command with a
timeout argument. The program will block until
the command returns an answer, in the form of a hash table (see
below), which could take up to several minutes.
The alternative way of calling
location.get is to pass it a
which is the name of a proc that will be called when
the information is available, with a hash table
specifying the results. Program execution continues
and does not block on the location.get call. The
callbackProc takes one argument,
which is a hash of information about the location.
-callback it is also
possible to specify a
(in seconds), and an
This is used in case of errors: the specified
Either method will supply the user with a hash table with the following elements. See also the JavaDocs here: javax/microedition/location/Location
haccuracy: horizontal accuracy, in meters.
vaccuracy: vertical accuracy, in meters.
location_method: contains a hash table of
its own with information about the method used to ascertain the
location. Possible values include:
ASSISTED: Location method is assisted.
UNASSISTED: Location method is unassisted.
NETWORKBASED: Location is derived
from the network.
TERMINALBASED: Location is obtained
from a GPS terminal.
ANGLEOFARRIVAL: Location method
Angle of Arrival for cellular / terrestrial RF system.
CELLID: Location method Cell-ID for
cellular (in GSM, this is the same as CGI, Cell Global
SATELLITE: Location method using
satellites (for example, Global Positioning System
SHORTRANGE: Location method
Short-range positioning system (for example, Bluetooth
TIMEDIFFERENCE: Location method
Time Difference for cellular / terrestrial RF system (for
example, Enhanced Observed Time Difference (E-OTD) for
TIMEOFARRIVAL: Location method Time
of Arrival (TOA) for cellular / terrestrial RF system.
speed: ground speed, in meters per second.
course: course, in degrees relative to true