|
||||||||||
PREV PACKAGE NEXT PACKAGE | FRAMES NO FRAMES |
See:
Description
Interface Summary | |
---|---|
Location | The Location class represents the standard set of basic location
information. |
LocationListener | The LocationListener represents a listener that receives events
associated with a particular LocationProvider . |
Class Summary | |
---|---|
Coordinates | The Coordinates class represents coordinates as
latitude-longitude-altitude values. |
Criteria | The criteria used for the selection of the location provider is defined by the values in this class. |
LocationProvider | This is the starting point for applications using this API and represents a source of the location information. |
MockLocationProvider | A LocationProvider for testing MIDlets. |
QualifiedCoordinates | The QualifiedCoordinates class represents coordinates as
latitude-longitude-altitude values that are associated with an accuracy
value. |
Exception Summary | |
---|---|
LocationException | The LocationException is thrown when a location API specific
error has occurred. |
Extends the JSR-179 Location API to support Bluetooth GPS devices and improve consistency across vendor implementations. This API helps in the following use cases:
Criteria
object. The API
also supports dynamic discovery of nearby Bluetooth devices (within 10 meters)
to get that address.
Not all of JSR-179 has been implemented. There are some missing classes but they are simple to add if you need them (and remember to contribute your work back!). Specifically the landmark store, proximity listener, a few other methods are not complete. None of those require GPS knowledge to implement.
Bluetooth GPS pucks are all fairly similar. There are slight variations in chipsets but the main differentiators are price, battery life, and packaging. We have tried a dozen of these over the past year and as of this writing (Nov 21, 2007) our recommendation is the OnCourse Edition 3 which costs $50 and is about the size of matchbox. You can purchase it through the link on the right (it comes with a car charger but not a wall charger; if you do not have a mini-USB charger a cheap one that works with it is listed alongside). |
Porting code written against the Location API (JSR-179) to J4ME is very simple.
Search for "javax.microedition.location
" and replace with
"org.j4me.bluetoothgps
".
That will insulate you from JSR-179 implementation variations but it will not
be able to connect to Bluetooth GPS devices. For that you must call
Criteria.setRemoteDeviceAddress(address)
where address
is the Bluetooth GPS puck's address. See the example for more information
including how to get the Bluetooth address.
An example is provided in the /examples
folder under the
org.j4me.examples.bluetoothgps
package. It is a simple pedometer
application that also outputs the various location data as it is received.
The example illustrates how to:
|
||||||||||
PREV PACKAGE NEXT PACKAGE | FRAMES NO FRAMES |