?
Solved

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

Posted on 2006-07-09
3
Medium Priority
?
957 Views
Last Modified: 2008-02-07
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.
0
Comment
Question by:jedigaj
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 35

Accepted Solution

by:
girionis earned 375 total points
ID: 17071045
Hi jedigaj

The valid characters for the bluetooth address are 0-9 and A-F, from the API documentation: "The Bluetooth address will be 12 characters long. Valid characters are 0-9 and A-F." If you know that this is a pattern you can write a method that makes all alpha characters lowercase after the 8th character.

Cheers
0
 

Author Comment

by:jedigaj
ID: 17071717
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
0
 
LVL 35

Expert Comment

by:girionis
ID: 17071738
Ah I see. Well glad you solved the problem anyway :) And thank you for accepting :)
0

Featured Post

Get real performance insights from real users

Key features:
- Total Pages Views and Load times
- Top Pages Viewed and Load Times
- Real Time Site Page Build Performance
- Users’ Browser and Platform Performance
- Geographic User Breakdown
- And more

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

An old method to applying the Singleton pattern in your Java code is to check if a static instance, defined in the same class that needs to be instantiated once and only once, is null and then create a new instance; otherwise, the pre-existing insta…
Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses
Course of the Month11 days, 9 hours left to enroll

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question