Link to home
Start Free TrialLog in
Avatar of jedigaj
jedigaj

asked on

How to get J2ME Bluetooth getBluetoothAddress() to return BT address in original format?

Hello,

Sorry if the question title sounds abit cryptic, but I am developing a J2ME game, which is based on location based gaming. I am not using the location api as not many phones support this api yet, so I am accessing information from the GPS receiver using parser to extract NMEA data.

The main problem is that GPS receiver does not have a service record. These service records usually contain a URL to create a connection to. So I have created a Bluetooth device search, which retrieves the friendly name and Bluetooth address. But the Bluetooth address function returns the address all in uppercase e.g.

Actual GPS receiver Bluetooth address:  00081B10a56e
getBluetoothAddress() function:             00081B10A56E

As with the original format you can see that the BT address is mixed with uppercase and lowercase letters and this makes a big difference as my program does not receive any information using getBluetoothAddress() function.

Please, if anyone can help me find a way to get the original bluetooth address format, I will be eternally grateful. In the mean time I am using a fixed url string, which defeats the dynamic purpose of the program.
ASKER CERTIFIED SOLUTION
Avatar of girionis
girionis
Flag of Greece image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of jedigaj
jedigaj

ASKER

Hello girionis,

I have found out that I had an error in my coding, inwhich I was using a getting  and setting methods for the bluetooth address. I was getting the bluetooth address before setting the the address, hence I always retreive a null value.

DOH!  (if you notice the time I posted the question, I probably needed some sleep!

Now it does not matter, if the bluetooth address is in uppercase or mixed cases. It still retreives the information even in uppercase.

For your quick response I will accept the answer.

Thanks girionis
Ah I see. Well glad you solved the problem anyway :) And thank you for accepting :)