Share on Google+Share on Google+

hariharan
Bluetooth application
1 Answer(s)      5 years and 8 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..

Ads

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
application for an Employee
application for an Employee  hi , could any one help for coding in JSP-servlets.. the prob desc is : 1.INPUT:in the 1st page it should accept input for an employeelike (name,empid ,address,dob) and persist in database 2.UPDATE
Tutorials   
Java Spring Hibernate Struts Training What does core Java include? java What are some way to learn Java quickly? Is it required to learn Java before learning Java Script? Is it necessary to learn java script before learning PHP? Are HTML5 and Java Script boosts Java career? Is Java object oriented? Fingerprint application with Java Uninstall Oracle Virtual Box JSON to HashMap Free Java online Training I want example of Control Statement in Java ANSI Color Codes with Python Create a Program that Calculates Input What is difference between JDK,JRE and JVM? How to see ubuntu version on server? How to get Page Source in Selenium (WebDriver) using Java? The path to the driver executable must be set by the webdriver.gecko.driver system property parse data from a link in java Java Program Qns using BlueJ How to fix HAX Kernel Module Is Not Installed error? Installing Audacity Looking for code Logic to check track changes & Coments in MSWord, MSWordx, MSExcel, MSExcelx is ON/OFF Installing JDK on Mac SAX Parser exception ERROR 601 (42P00): Syntax error. Encountered Thread java.lang.NoClassDefFoundError: org/apache/commons/fileupload/FileItemFactory How to install Ubuntu 16.04 LTS? HttpServletRequest cannot be resolved to a type in eclipse - Solved Unhandled event loop exception GC overhead limit exceeded Spring Data jpa with apache phoenix Caused by: java.lang.IllegalArgumentException: Not a host:port pair: PBUF o.a.h.h.z.RecoverableZooKeeper - Possibly transient ZooKeeper, quorum= com.thinkaurelius.titan.diskstorage.hbase.HBaseStoreManager class not found com.thinkaurelius.titan.diskstorage.hbase.HBaseStoreManager not found How to download and install Java 8 on Windows? How to uninstall JDK 7? How to install gtk-doc-tools package in Ubuntu? How to install Oracle JDK 8 on Ubuntu? ejabberd_ctl.beam not found - Solved How to convert date to UTC format in Java? How to install autoconf, automake and libtool in Ubuntu 15.10? How to convert current date to mm dd yyyy format in Java? How to convert current date to dd mm yyyy format in Java? How to stop window closing in "internalFrameClosing" event. How to find list of all index in Neo4j? neo4j-server.properties file location SASLError using PLAIN: not-authorized how to convert war file into .exe file using java code

Ads

 
Advertisement null

Ads