JavaMe Bluetooth service registration

Posted by NoGlue on Stack Overflow See other posts from Stack Overflow or by NoGlue
Published on 2010-05-04T10:19:26Z Indexed on 2010/05/04 10:28 UTC
Read the original article Hit count: 250

Filed under:
|
|

Hello,

I am trying to develope an application that offers a service via bluetooth. Everything works fine in the emulator but as soon I install it on a real device (6120/X6 Nokia) the service cannot be found.

If I search for already registered services such as OBEX they are found. So I think it has something to do with the registration.

This is how I register the service, all of this happens in its own thread.

try {
   LocalDevice.getLocalDevice().setDiscoverable(DiscoveryAgent.GIAC);

  } catch (BluetoothStateException e) {

  }
  try {
   notifier = (StreamConnectionNotifier) Connector.open(m_url);
   ServiceRecord sr = local.getRecord(notifier);

   StreamConnection conn = notifier.acceptAndOpen();
  } catch (IOException e) {

  }

And this is what m_url looks like:

"btspp://localhost:" + 0x1116  + ";name=BlueMatch";

Thanks for your time.

Best regards

© Stack Overflow or respective owner

Related posts about java

Related posts about bluetooth