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: