Hi! Thanks for visiting my blog. If you've received any value from my content would you mind supporting my new startup by downloading our browser add-on? It's called PriceBlink and makes online shopping a breeze. You can watch it in action here and download it for Chrome, Firefox, IE, or Safari by going to PriceBlink.com. Thank you and I hope you enjoy!

BlueGPS for J2ME – The Saga Continues

Aug 29

In my last post I mentioned that I was unable to retrieve the Bluetooth address of my GPS receiver, this wasn’t entirely accurate. I stumbled across Benhui’s Bluelet library that simplies Bluetooth device/service discovery. This worked like a charm but the problem turned out to be making a call for the first service record:

ServiceRecord r = bluelet.getFirstDiscoveredService();

kept returning null. Therefore I was unable to retrieve the connection URL for connecting to the device using the serial port profile. So what I had to do was build the URL manually from the device’s Bluetooth address. So in the Bluelet code I created a variable that stores the device address and was able to access it my MIDlet using:

url = “btspp://” + bluelet.btaddr + “:1″;

Notice the connection string built around the device address. I’ve successfully connected to the device and now it’s time to write the parser to decode the NMEA 0183 sentences.