Bluetooth application

Ads
 

Bluetooth application

i want program for finding Bluetooth id, port no, initialize servicing and discovery... pls if u known means help me..

View Answers

June 12, 2013 at 11:18 AM

 public void BluetoothDeviceSearch() {
    final Object inquiryCompletedEvent = new Object();

    devicesDiscovered.clear();
    DiscoveryListener listener = new DiscoveryListener() {

        @Override
        public void deviceDiscovered(RemoteDevice btDevice, DeviceClass cod) {
            System.out.println("Device " + btDevice.getBluetoothAddress() + " found");
            devicesDiscovered.addElement(btDevice);
            try {
                System.out.println("     name " + btDevice.getFriendlyName(false));
            } catch (IOException cantGetDeviceName) {
            }
        }

        @Override
        public void inquiryCompleted(int discType) {
            System.out.println("Device Inquiry completed!");
            synchronized (inquiryCompletedEvent) {
                inquiryCompletedEvent.notifyAll();
            }
        }

        @Override
        public void serviceSearchCompleted(int transID, int respCode) {
        }

        @Override
        public void servicesDiscovered(int transID, ServiceRecord[] servRecord) {
        }
    };
    synchronized (inquiryCompletedEvent) {
        boolean started = false;
        try {
            started = LocalDevice.getLocalDevice().getDiscoveryAgent().startInquiry(DiscoveryAgent.GIAC, listener);
        } catch (BluetoothStateException ex) {
            Logger.getLogger(BluetoothFinder.class.getName()).log(Level.SEVERE, null, ex);
        }
        if (started) {
            System.out.println("wait for device inquiry to complete...");
            try {
                inquiryCompletedEvent.wait();
            } catch (InterruptedException ex) {
                Logger.getLogger(BluetoothFinder.class.getName()).log(Level.SEVERE, null, ex);
            }
            System.out.println(devicesDiscovered.size() + " device(s) found");
        }
    }

}

Ads









Related Tutorials/Questions & Answers:
Bluetooth application
Bluetooth application  i want program for finding Bluetooth id, port no, initialize servicing and discovery... pls if u known means help me
What is the use of Bluetooth technology
What is the use of Bluetooth technology  What is the use of Bluetooth technology?   Bluetooth technology is used for Wireless communication between equipment's
Advertisements
Sending data using bluetooth in android
Sending data using bluetooth in android  code to send data between two android mobile devices using bluetooth
how to turn off bluetooth on mac
how to turn off bluetooth on mac  I want to know ..how to turn off the bluetooth on my mac system. Thanks
how to turn off bluetooth on mac
how to turn off bluetooth on mac  I want to know ..how to turn off the bluetooth on my mac system. Thanks
Version of com.neovisionaries>nv-bluetooth dependency
List of Version of com.neovisionaries>nv-bluetooth dependency
ModuleNotFoundError: No module named 'bluetooth-mesh'
ModuleNotFoundError: No module named 'bluetooth-mesh'  Hi, My... named 'bluetooth-mesh' How to remove the ModuleNotFoundError: No module named 'bluetooth-mesh' error? Thanks   Hi, In your python
OS service via bluetooth socket
OS service via bluetooth socket  through bluetooth socket i want to send instructions to the OS, where i dont want any server code for this on my PC or Laptop. My instructions should be handled by the OS inbuilt bluetooth
serial port communication using bluetooth in j2me
serial port communication using bluetooth in j2me   how to make serial port communication using bluetooth in j2me ? what r prerequisites
serial port communication using bluetooth in j2me
serial port communication using bluetooth in j2me   how to make serial port communication using bluetooth in j2me ? what r prerequisites
Maven Dependency nv-bluetooth >> 1.6
You should include the dependency code given in this page to add Maven Dependency of com.neovisionaries >> nv-bluetooth version1.6 in your project
Maven Dependency nv-bluetooth >> 1.1
You should include the dependency code given in this page to add Maven Dependency of com.neovisionaries >> nv-bluetooth version1.1 in your project
Maven Dependency nv-bluetooth >> 1.8
You should include the dependency code given in this page to add Maven Dependency of com.neovisionaries >> nv-bluetooth version1.8 in your project
Maven Dependency nv-bluetooth >> 1.2
You should include the dependency code given in this page to add Maven Dependency of com.neovisionaries >> nv-bluetooth version1.2 in your project
Maven Dependency nv-bluetooth >> 1.7
You should include the dependency code given in this page to add Maven Dependency of com.neovisionaries >> nv-bluetooth version1.7 in your project
Maven Dependency nv-bluetooth >> 1.3
You should include the dependency code given in this page to add Maven Dependency of com.neovisionaries >> nv-bluetooth version1.3 in your project
Maven Dependency nv-bluetooth >> 1.5
You should include the dependency code given in this page to add Maven Dependency of com.neovisionaries >> nv-bluetooth version1.5 in your project
Maven Dependency nv-bluetooth >> 1.0
You should include the dependency code given in this page to add Maven Dependency of com.neovisionaries >> nv-bluetooth version1.0 in your project
Maven Dependency nv-bluetooth >> 1.4
You should include the dependency code given in this page to add Maven Dependency of com.neovisionaries >> nv-bluetooth version1.4 in your project
Collect Mac Address Connected via Bluetooth
Collect Mac Address Connected via Bluetooth  How to collect automatically all mac address connected via bluetooth and save in a file
Swing application
Swing application  Hello, I want to develop a Swing application... the application not through web browsers, instead through a Swing desktop application GUIs. Please help me to develop such an application
web application
web application  what is lazy loading in web based application
Hibernate application
Hibernate application   Hi, I am using Netbeans IDE.I need to execute a **Hibernate application** in Netbeans IDE.can any one help me to do
bank application
bank application  hello sir I got the simple bank application project which is very useful but I want the database for this project kindly send me database for this simple online bank application
web application
web application  Dear friend, could u plz tell me wats difference bt web server,application server,container with thanks praveen
struts application
struts application  hi, how to retrive data from databse in struts application aand send the retrived data to corresponding form
jsp application
jsp application  write a jsp application that will receive an integer from the client , check if the integer is even or odd and send the result to the client
Introduction To Application
Introduction To Application The present application is an online test application, which takes online tests on programming languages. In this application... actions, forwarding request from one action to other etc. In this application
chat application
chat application  I am trying to make a chat application , when user1 send private message to user2 ,a popup should show at user2's screen. i need this code
login application
login application  how to create login application ?   Hi, Please check the following tutorials: Video tutorial - JSP Login Logout... & authenticate it from database mysql Project of a web application
what is the difference between distributed application and web application?
what is the difference between distributed application and web application?  what is the difference between distributed application and web application

Ads