1

I am trying to connect to a bluetooth device from the blackberry 9900 phone using the following code;

public final class AppMainScreen extends MainScreen {
private BluetoothspInfo[] spInfo;
    private StreamConnection bConn;
    private DataInputStream diStream;
    private String text;

    public AppMainScreen() {

        spInfo = BluetoothSerialPort.getSerialPortInfo();

        try {
            bConn = (StreamConnection) Connector.open(
                    spInfo[0].toString(), Connector.READ);
        } catch (IOException e) {
            e.printStackTrace();
        } catch (Exception e) {
            e.printStackTrace();
        }

        UiApplication.getUiApplication().invokeLater(new TextScanner());
    }

    // ...
    // ...
    // ...
}

But its always throwing the exception java.io.IOException: Unable to connect. I am not able to get the full trace. What is the problem here, can anybody please point me in the right direction. I am using the BlackBerry Java on BlackBerry Eclipse Plugin with Platform version 4.5.

Greenhorn
  • 769
  • 2
  • 8
  • 17

0 Answers0