Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

New Developer
Posts: 3
Registered: ‎07-19-2008
My Device: 8110

Bluetooth Serial Port Problems

I have written a small application that communicates with a bluetooth device (Serial Port Profile) that acts as the master (i.e. it sends data whenever it is ready).  This device communicates fine with my PC.  Below is a snippet of my code which runs on a background thread:


            String url = "btspp://localhost:10;name=Access;authenticate=true;master=false;encrypt=true";
            _server = (StreamConnectionNotifier) Connector.open(url, Connector.READ_WRITE, false);
        catch(Exception e){
            String msg = e.toString();
        //Waiting for connection and receiving data:
            StreamConnection connection = null;
                connection = _server.acceptAndOpen();



This code worked for 2 days fine.  Then something happened.  What I believe happened is this:  The application was being debugged through the serial port connection in order to have the bluetooth working.  I realized where a bug was and went to change it.  Stopped the debugger and recompiled the code (resigned etc.).  I then went to the Application Loader and uninstalled the application.  What I forgot to do was actually exit the application on the device.  So because a backround thread was running this caused a complete reboot of the device.  At this point, I believe that it left the serial port connected or marked somehow as now no matter what I do (even to the drastic extent of re-installing my device OS), the bluetooth device cannot connect.  What I need to know is if there is anyway I can examine the records in the Bluetooth Serial Port Database to see if there is actually a connection still out there.  If there is such a way, can I remove it.


I have tried changing the port number from 10 to something else (8) with no luck.  Once before I made this work with port 1 but that no longer responds either.


I have also tried creating UUID's and using those (either long form, x1101 or something like 10) and nothing works.  The device fails to communicate with the Blackberry.  Also, I have disabled Desktop Connectivity in the Bluetooth options.


JDE: 4.5

My OS:

My Device 8110/Rogers