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
Highlighted
Developer
Posts: 224
Registered: ‎03-29-2012
My Device: 9900
My Carrier: Wind

Bluetooth Device Search TimeOut Timer

Im using a bluetooth search to detect devices in range and get their name, however, if the devices go out of range or are weakly detected, I suspect that they take longer for the device.getFriendlyName(true); method to return the device name and in some cases it returns null as it cannot determine the name.

 

I dont want these weakly detected devices to delay the search by taking longer to return the name or null, and would like a timeout that stops the attempted method after a certain time, 5 seconds for example. i am new to timers and will continue to investigate this, can  this be reasonably accomplished?