Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa Java-Beginners Bluetooth application
Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


hariharan
Bluetooth application
1 Answer(s)      3 years and 3 months ago
Posted in : Java Beginners


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


Advertisement
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");
        }
    }

}


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
bluetooth headset - Java Beginners
bluetooth headset  dear group members can anyone tell me is it possible to send voice command to pc by bluetooth headset. if possible then how? wish ur all the best thanks mithun
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
Bluetooth devices can communicate concurrently
Bluetooth devices can communicate concurrently  hii, How many Bluetooth devices can communicate concurrently?   hello, A Bluetooth... computer network of devices using Bluetooth technology protocols to allow one
Car Music Streaming via iPhone Bluetooth, iphone Bluetooth Audio Streaming
Stream iPhone Music in Car Using Bluetooth One of the nicest features... the iPhone to the Car audio using Bluetooth. If your car has a supported Bluetooth... Bluetooth
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
conecting mobile to bluetooth printer - MobileApplications
conecting mobile to bluetooth printer   Hi all, Can anyone tell me how to print data from the mobile to pocketjet3plus printer. Please suggest me as soon as possible
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
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
iPhone 3.0 Update Reveals the Long Missing Bluetooth Features
and paste and most annoyingly, the lack of advanced Bluetooth features. But why enable and not add? Because my dear friend, the Bluetooth features were present... the Bluetooth features ought to be unlocked. But as usual, Apple is in no mood
web application
web application  what is lazy loading in web based application
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
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
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
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
struts application
struts application  hi, how to retrive data from databse in struts application aand send the retrived data to corresponding form
web application
web application  Dear friend, could u plz tell me wats difference bt web server,application server,container with thanks praveen
registration application
registration application  How to develop a registration application in struts which has seperate file for database connection and data checking and form and action
iPad application designer
iPad application designer Are you looking for the experienced graphics designer for designing your iPad application? Look no further, we provide professional iPad application designing services. We have a team of iPad application
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
mobile application
mobile application  how can i start my android application project. My project topic is India map puzzle its my mini project within 7 days i should do that so guys plzzzzzz help me in this .... plz share ur idea with me as soon
RegisterForm Application
RegisterForm Application  I am trying run an simple struts application, but it is giving me error: HTTP-status 404 type-status report message-/register description-The requested resource (/register) is not available. plz give me
Architecture of application
components: - Desktop client application (multi-user, multi-role) - Swing... what schould I read, internet links, tutorials would be useful for me. Application... to comunicate between client and middleware running on top of application server, some
Application Variable
Application Variable  I have multiple JSP's that are connected to a Database specifically MSSQL, I connect to the DB using a property file containing the necessary data to establish a connection.. In every page I have to call
Swing Application
Swing Application  hello, i am making swing application in java i am unable to run prog......when my rite clikcing on my project name and clicking thn run it is not showing output .....and when i am cliking on individual java
Advertisements
 

 

 

DMCA.com