Welcome!

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

Reply
New Contributor
Posts: 3
Registered: ‎08-04-2010
My Device: Not Specified

Bluetooth disconnection event

Hi!

 

I'm working on an application where I need to monitor the connection of a paired bluetooth device. How can this be done? Is there any Bluetooth event which is broadcasted at connection/disconnection which I can listen to?

 

If not, would it be possible to perhaps have a timer running in the background and check each X seconds if the device is connected or not?

 

The app needs to run in the background and from startup.

 

 

Developer
Posts: 1,452
Registered: ‎11-06-2009
My Device: Torch 9810

Re: Bluetooth disconnection event

You can use Listener:

net.rim.device.api.bluetooth
Interface BluetoothSerialPortListener

 

methods deviceConnected(boolean success)/ deviceDisconnected() should deliver what you need



"When you become a level 3 developer, you learn to communicate over the ether. I'm told that level 5 developers are ascend into a higher level of existence beyond the physical realm." gord888 @ crackberry
New Contributor
Posts: 3
Registered: ‎08-04-2010
My Device: Not Specified

Re: Bluetooth disconnection event

Thanks for the reply!

 

The Bluetooth device I'm currently using doesn't have SPP implemented. Would BluetoothSerialPortListener still work to use as a listenred for connections and disconnections?