Q:

API Error for BluetoothSerialPort.getSerialPortInfo()

I am using BluetoothSerialPort.getSerialPortInfo() for extracting devices which are paired during Bluetooth connection.
But this works some times and does not other times it gives null other times ...
What is the problem?

A:

I got my answer from this link 
http://supportforums.blackberry.com/t5/Java-Development/Bluetooth-serial-Port-example/td-p/22101

Issue solved by accident:
Before you paired the two devices,
1) you need to open the "Bluetooth sample" and select "listen for
  connections". you can either use one or both devices for listening(in
  this case you will have bi-direction connection initilization, which
  is cool~).
2)then let the "Bluetooth sample" APPLICATION run at the background,
  open the regular Set up Blue tooth options, one listen and the other
  search for connection. then pair the two devices.
3)now, you could have the bluetooth option at the "Bluetooth sample"
  quit and re-start the applications
4)start bluetooth data transfer.

