Java – J2ME Bluetooth – discover a service with unknown details

bluetoothjava-me

Lets say I have a device which my cell phone can connect to via bluetooth (it can be any device on the market…)

For being able to connect this device using a J2ME application on my cell phone, I need to discover the device first, and then discover the service which the device lets cell phones connect to.

My problem is that I don't know how to discover that service…. the device is being discovered with no problems by the J2ME application, but for discovering the service of this device, I need service's UUID and Attributes (J2ME API requirements), which I have no idea where and how to get.

Does anyone know how can I still connect the device's service using a J2ME application, without knowing service's UUID and Attributes ?

Thanks!

Best Answer

As far as I know, there is nothing in the API to directly do "remote service discovery", but I found this, which I think is about that:

Service discovery allows you to find nearby services, regardless of what devices are offering them. DiscoveryAgent provides methods to discover services on a Bluetooth server device and to initiate service-discovery transactions. Before a service can be discovered, it must first be registered or advertised on a Bluetooth server device. The server is responsible for a number of things, including creating a service record that describes the service offered, accepting connections from clients, and adding a service record to the server's Service Discovery Database (SDDB). In general, it works like Web services.

Related Topic