BlackBerry Forums Support Community
              

Closed Thread
 
Thread Tools
Old 05-10-2010, 03:19 AM   #1
spom
New Member
 
Join Date: May 2009
Model: 8900
PIN: N/A
Carrier: xyz
Posts: 3
Default Discover bluetooth device

Please Login to Remove!

Hi,
as I'm not familiar in programming BB I have the following problem:
I want to have a listener which listens for a special bluetooth device. So I tried it with the following code (it's just a snippet) using javax.bluetooth:
Code:
public void startApp() {
         try {
            LocalDevice localDevice = LocalDevice.getLocalDevice();
            DiscoveryAgent discoveryAgent = localDevice.getDiscoveryAgent();

            discoveryAgent.startInquiry(DiscoveryAgent.GIAC, this);
            
         } catch (Exception e) {
            
         }
   }

public void deviceDiscovered(RemoteDevice remoteDevice, DeviceClass deviceClass) {
	founded = "Discovered Device: " + remoteDevice.getFriendlyName(true);      
   }

public void inquiryCompleted(int num) {      
   }

public void servicesDiscovered(int transId, ServiceRecord[] serviceRecords) {
   }

public void serviceSearchCompleted(int arg0, int arg1) {
   }
When the inquiry ist completed public void inquiryCompleted(int num) is called. But I want that my BB is listening all the time for the special device. How can I do that? Do I need a loop?
Secondly as mentioned above I want to listen for a special already paired device and not for all bluetooth devices. How can I do that?

Thank you very much.
Offline  
Closed Thread



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


JOSLYN CLARK TB-137-2 CONTROLS COIL TB1372 240VDC picture

JOSLYN CLARK TB-137-2 CONTROLS COIL TB1372 240VDC

$149.00



Manual Dual Purpose Coil Winder Hand Coil Winding Machine Count 0-99999 picture

Manual Dual Purpose Coil Winder Hand Coil Winding Machine Count 0-99999

$39.05



Ignition Coil for Ford Tractor 12V 2000 3000 4000 5000 Naa600 800 1965 & Up D5TE picture

Ignition Coil for Ford Tractor 12V 2000 3000 4000 5000 Naa600 800 1965 & Up D5TE

$26.38



Allstyle ASUM48A3Z64G4 Tons Aluminum Type Uncased Mobile Home Coil New/Open Box picture

Allstyle ASUM48A3Z64G4 Tons Aluminum Type Uncased Mobile Home Coil New/Open Box

$299.00



1 Pole Air Conditioner Contactor 40 Amp 24VAC Coil,Condenser Contactor Co picture

1 Pole Air Conditioner Contactor 40 Amp 24VAC Coil,Condenser Contactor Co

$23.26



GE CL06A300MJ Non-Reversing IEC Contactor, 110/120 VAC V Coil, 50 A picture

GE CL06A300MJ Non-Reversing IEC Contactor, 110/120 VAC V Coil, 50 A

$299.99







Copyright © 2004-2016 BlackBerryForums.com.
The names RIM © and BlackBerry © are registered Trademarks of BlackBerry Inc.