Bluetooth selectService() ?

Hi all,
I'm having problem with the following code:
LocalDevice local = LocalDevice.getLocalDevice();
DiscoveryAgent agent = local.getDiscoveryAgent();
String connString = agent.selectService(
new UUID("86b4d249fb8844d6a756ec265dd1f6a3", false),
ServiceRecord.NOAUTHENTICATE_NOENCRYPT, false);
The error with WTK2.2:
C:\WTK22\apps\Setting\src\Setting.java:137: cannot find symbol
symbol : method selectService(javax.bluetooth.UUID,int,boolean)
location: class javax.bluetooth.DiscoveryAgent
String connString = agent.selectService(
^
1 error
com.sun.kvem.ktools.ExecutionException
Build failed
Could anyone help me please ?
Thanks.

selectService method attempts to locate a service that contains uuid in the ServiceClassIDList of its service record.so chk for uuid present in serviceRecord.

Similar Messages

  • Bluetooth selectService/searchService problems

    Hello,
    I have the next problem, I have a client midlet that looks for a bluetooth service implemented. I can found the service with Nokia 6230 but not with N70, obviously it's the same code. I think it could be because N70 works with Symbian. I have tried using selectService and searchService methods and both works in 6230 but not in N70
    ¿can anyone help me?
    I really need to solve this problem.

    This is the code i'm testing with. I always obtain the same message "Required service haven't been found" so searchServices function always return SERVICE_SEARCH_NO_RECORDS. As i have told in previews messages, it works in Nokia 6230, Sony-Ericsson K800i but not in Nokia N70.
    Any idea?
    public class test extends MIDlet {
    private LocalDevice localDevice;
    private DiscoveryAgent da;
    private Vector devices;
    private Vector services;
    public static final UUID[] SERVICIOS = new UUID[2];
    private Listener listener ;
    private Display display;
    public void startApp() {
    frm.append("buscando");
    SERVICIOS[0] = new UUID(0x1101);
    SERVICIOS[1] = new UUID("12345678901234567890123456789012",false);
    this.devices = new Vector();
    this.services = new Vector();
    listener = new Listener();
    try{
    localDevice = LocalDevice.getLocalDevice();
    localDevice.setDiscoverable(DiscoveryAgent.GIAC );
    catch(BluetoothStateException e){
    System.out.println("Error al iniciar.");
    da = localDevice.getDiscoveryAgent();
    display = Display.getDisplay(this);
    display.setCurrent(frm);
    lookDevices();
    public void pauseApp() {
    public void lookDevices(){
    //Looking for bluetooth devices
    try{
    da.startInquiry(DiscoveryAgent.GIAC, listener);
    catch(BluetoothStateException e){
    alert.setString("Error looking devices");
    display.setCurrent(alert);
    public void lookServices(){
    try{
    for(int i = 0; i < devices.size();i++){
    alert.setString("antes search");
    display.setCurrent(alert);
    int transid = da.searchServices(null, SERVICIOS, (RemoteDevice)devices.elementAt(i), listener);
    alert.setString("After search");
    display.setCurrent(alert);
    catch(BluetoothStateException e){
    alert.setString("Error looking services");
    display.setCurrent(alert);
    private class Listener implements DiscoveryListener{
    public void deviceDiscovered(RemoteDevice remoteDevice, DeviceClass devclass){
    try{
    devices.addElement(remoteDevice);
    alert.setString("Device discovered");
    display.setCurrent(alert);
    catch(Exception e){
    alert.setString("Error adding device");
    display.setCurrent(alert);
    public void inquiryCompleted(int completed){           
    switch(completed){                   
    case INQUIRY_COMPLETED:
    if (devices.size() > 0) {    
    alert.setString("looking services");
    display.setCurrent(alert);
    lookServices();
    else
    alert.setString("Not devices found");
    display.setCurrent(alert);
    break;
    case INQUIRY_TERMINATED:
    devices.removeAllElements();
    alert.setString("Seach have been finished");
    display.setCurrent(alert);
    break;
    case INQUIRY_ERROR:
    alert.setString("Error looking devices...");
    display.setCurrent(alert);
    break;
    public void serviceSearchCompleted(int transID, int respCode){
    if (respCode == SERVICE_SEARCH_COMPLETED )
    if(services.size()>0){
    devicesNames();
    else if (respCode == SERVICE_SEARCH_NO_RECORDS )
    alert.setString("Required service haven't been found");
    display.setCurrent(alert);
    public void servicesDiscovered(int transID, ServiceRecord[] servRecord){      
    for(int i=0;i<servRecord.length;i++){
    ServiceRecord record = servRecord;
    services.addElement(record);
    alert.setString("Service found");
    display.setCurrent(alert);
    {noformat}

  • Question about bluetooth communication between PC and mobile device

    I am a newbie of bluetooth communication. This time I need to have connumication between PC and mobile device (mainly mobile phone) by sending strings. PC is acted as server and mobile device act as client.
    For using bluetooth in PC, I use bluecove 2.0.1
    I have already connected them successfully.
    When I want to send strings between them, it is found that it can only do one cycle of communication (client -> server -> client).
    For my design, they can communicate multiple times.
    I simulate the core class of the system, the performance is fine.
    Cound anyone help me to watch the code and give me some advices?
    Server Side - ServerBox.java
    public class ServerBox implements Runnable {
       LocalDevice localDevice;
       StreamConnectionNotifier notifier;
       ServiceRecord record;
       boolean isClosed;
       ClientProcessor processor;
       CMDProcessor cmd;
       MainInterface midlet;
       private static final UUID ECHO_SERVER_UUID = new UUID(
               "F0E0D0C0B0A000908070605040302010", false);
       public ServerBox(MainInterface midlet) {
           this.midlet = midlet;
       public void run() {
           boolean isBTReady = false;
           try {
               localDevice = LocalDevice.getLocalDevice();
               if (!localDevice.setDiscoverable(DiscoveryAgent.GIAC)) {
                   midlet.showInfo("Cannot set to discoverable");
                   return;
               // prepare a URL to create a notifier
               StringBuffer url = new StringBuffer("btspp://");
               url.append("localhost").append(':');
               url.append(ECHO_SERVER_UUID.toString());
               url.append(";name=Echo Server");
               url.append(";authorize=false");
               // create notifier now
               notifier = (StreamConnectionNotifier) Connector.open(url.toString());
               record = localDevice.getRecord(notifier);
               isBTReady = true;
           } catch (Exception e) {
               e.printStackTrace();
           // nothing to do if no bluetooth available
           if (isBTReady) {
               midlet.showInfo("Initalization complete. Waiting for connection");
               midlet.completeInitalization();
           } else {
               midlet.showInfo("Initalization fail. Exit.");
               return;
           // produce client processor
           processor = new ClientProcessor();
           cmd = new CMDProcessor();
           // start accepting connections then
           while (!isClosed) {
               StreamConnection conn = null;
               try {
                   conn = notifier.acceptAndOpen();
               } catch (IOException e) {
                   // wrong client or interrupted - continue anyway
                   continue;
               processor.addConnection(conn);
       // activate the set up of process
       public void publish() {
           isClosed = false;
           new Thread(this).start();
       // stop the service
       public void cancelService() {
           isClosed = true;
           midlet.showInfo("Service Terminate.");
           midlet.completeTermination();
       // inner private class for handling connection and activate connection handling
       private class ClientProcessor implements Runnable {
           private Thread processorThread;
           private Vector queue = new Vector();
           private boolean isOk = true;
           ClientProcessor() {
               processorThread = new Thread(this);
               processorThread.start();
           public void run() {
               while (!isClosed) {
                   synchronized (this) {
                       if (queue.size() == 0) {
                           try {
                               // wait for new client
                               wait();
                           } catch (InterruptedException e) { }
                   StreamConnection conn;
                   synchronized (this) {
                       if (isClosed) {
                           return;
                       conn = (StreamConnection) queue.firstElement();
                       queue.removeElementAt(0);
                       processConnection(conn);
           // add stream connection and notify the thread
           void addConnection(StreamConnection conn) {
               synchronized (this) {
                   queue.addElement(conn);
                   midlet.showInfo("A connection is added.");
                   notify();    // for wait() command in run()
       // receive string
       private String readInputString(StreamConnection conn) {
           String inputString = null;
           try {
               DataInputStream dis = conn.openDataInputStream();
               inputString = dis.readUTF();
               dis.close();
           } catch (Exception e) {
               e.printStackTrace();
           return inputString;
       private void sendOutputData(String outputData, StreamConnection conn) {
           try {
               DataOutputStream dos = conn.openDataOutputStream();
               dos.writeUTF(outputData);
               dos.close();
           } catch (IOException e) {
       // process connecion
       private void processConnection(StreamConnection conn) {
           String inputString = readInputString(conn);
           String outputString = cmd.reactionToCMD(inputString);
           sendOutputData(outputString, conn);
    /*       try {
               conn.close();
           } catch (IOException e) {}*/
           midlet.showInfo("Client input: " + inputString + ", successfully received.");
    }For "CMDProcessor" , it is the class of message processing before feedback to client.
    Client side - ClientBox.java
    public class ClientBox implements Runnable, CommandListener{
        StringItem result = new StringItem("","");
        private DiscoveryAgent discoveryAgent;
        private String connString;
        private boolean isClosed = false;
        private boolean boxReady = false;
        StreamConnection conn;
        private static final UUID ECHO_SERVER_UUID = new UUID( "F0E0D0C0B0A000908070605040302010", false);
        Form process = new Form("Process");
        ClientInterface midlet;
        public ClientBox(ClientInterface mid){
            this.midlet = mid;
            process.append(result);
            process.addCommand(new Command("Cancel",Command.CANCEL,1));
            process.setCommandListener(this);
            new Thread(this).start();
        public void commandAction(Command arg0, Displayable arg1) {    
            if(arg0.getCommandType()==Command.CANCEL){
                isClosed = true;
                midlet.notifyDestroyed();
        public synchronized void run() {
            LocalDevice localDevice = null;
            boolean isBTReady = false;
            /* Process Gauge screen */
            midlet.displayPage(process);
            Gauge g=new Gauge(null,false,Gauge.INDEFINITE,Gauge.CONTINUOUS_RUNNING);
            process.append(g);
            showInfo("Initalization...");
            System.gc();
            try {
                localDevice = LocalDevice.getLocalDevice();
                discoveryAgent = localDevice.getDiscoveryAgent();
                isBTReady = true;
            } catch (Exception e) {
                e.printStackTrace();
            if (!isBTReady) {
                showInfo("Bluetooth is not avaliable. Please check the device.");
                return;
            if(!isClosed){
                try {
                    connString = discoveryAgent.selectService(ECHO_SERVER_UUID, ServiceRecord.NOAUTHENTICATE_NOENCRYPT, false);
                } catch (BluetoothStateException ex) {
                    ex.printStackTrace();
            else return;
            if (connString == null) {
                showInfo("Cannot Find Server. Please check the device.");
                return;
            else showInfo("Can Find Server, stand by for request.");
            boxReady = true;
        /* True if the clientbox is ready */
        public boolean getBoxReady(){
            return boxReady;
        /* True if the clientbox is closed in run() */
        public boolean getIsClosed(){
            return isClosed;
        public String accessService(String input) {
            String output = null;
            try {
                /* Connect to server */
                StreamConnection conn = (StreamConnection) Connector.open(connString);
                /* send string */
                DataOutputStream dos = conn.openDataOutputStream();
                dos.writeUTF(input);
                dos.close();
                /* receive string */
                DataInputStream dis = conn.openDataInputStream();
                output = dis.readUTF();
                dis.close();
            } catch (IOException ex){
                showInfo("Fail connect to connect to server.");
            return output;
        private void showInfo(String s){
            StringBuffer sb=new StringBuffer(result.getText());
            if(sb.length()>0){ sb.append("\n"); }
            sb.append(s);
            result.setText(sb.toString());
    }Client side - ClientInterface.java
    public class ClientInterface extends MIDlet implements Runnable, CommandListener{
        private ClientBox cb = new ClientBox(this);
        private Form temp = new Form("Temp");
        private Command select = new Command("Select", Command.OK, 1);
        private Command back = new Command("Back", Command.BACK, 1);
        Alert alert;
        String[] element;
        String out;
        List list;
        public void run(){
            /* Send message and get reply */
            out = cb.accessService("Proglist");
            element = split(out,",");
            /* Use the reply to make list */
            list = createList(element[0], List.IMPLICIT, out);
            list.addCommand(select);
            list.addCommand(back);
            list.setCommandListener(this);
            Display.getDisplay(this).setCurrent(list);
        public void startApp() {
            System.gc();
            waitForBoxSetUp(); /* Recursively check for clientbox status */
            new Thread(this).start();
        public void pauseApp() {
        public void destroyApp(boolean unconditional) {
            notifyDestroyed();
        public void displayPage(Displayable d){
            Display.getDisplay(this).setCurrent(d);
        private void waitForBoxSetUp(){
            while(!cb.getBoxReady()){
                if(cb.getIsClosed())
                    notifyDestroyed();
        public void commandAction(Command c, Displayable d){
            if (c.getCommandType() == Command.OK){
                if (d == list){
                    /* Send the choice to server */
                    out = cb.accessService(list.getString(list.getSelectedIndex()));
                    alert = new Alert("Output", "selected = "+out, null, AlertType.ALARM);
                    alert.setTimeout(2000);
                    Display.getDisplay(this).setCurrent(alert,list);
            if (c.getCommandType() == Command.BACK){
                notifyDestroyed();
        public void showWarning(String title, String content){
            alert = new Alert("Output", "selected = "+list.getString(list.getSelectedIndex()), null, AlertType.ALARM);
            alert.setTimeout(3000);
            Display.getDisplay(this).setCurrent(alert,list);
        private List createList(String name, int type, String message){
            List temp;
            String[] source = split(message,",") ;
            temp = new List(name, type, source, null);
            return temp;
        private static String[] split(String original,String regex)
            int startIndex = 0;
            Vector v = new Vector();
            String[] str = null;
            int index = 0;
            startIndex = original.indexOf(regex);
            while(startIndex < original.length() && startIndex != -1)
                String temp = original.substring(index,startIndex);
                v.addElement(temp);
                index = startIndex + regex.length();
                startIndex = original.indexOf(regex,startIndex + regex.length());
            v.addElement(original.substring(index + 1 - regex.length()));
            str = new String[v.size()];
            for(int i=0;i<v.size();i++)
                str[i] = (String)v.elementAt(i);
            return str;
    }

    i haven't worked with devices but only with the toolkit emulators;
    it definitely is possible...
    u have to send the image as a bytestream and receive the image at the jsp end...
    and then reconstruct the image.
    the Stream classes in J2ME AND J2SE are all u will require.
    also the Image class.
    i have not done this but i have successfully sent an image frm a jsp and displayed it on the emulator.

  • Bluetooth: Unable to detect devices on Nokia Phones

    Hi
    The following piece of code for bluetooth detection and connection works(able to detect and connect to other bluetooth devices) on my Sony Ericsson K750i Phone but not on a Nokia N81(unable to detect any bluetooth devices).
    Can someone please help, i need this thing urgently.
    Many thanks
    Mark
    package ECG;
    import javax.bluetooth.*;
    import javax.microedition.io.Connector;
    import java.io.DataInputStream;
    import java.io.DataOutputStream;
    import java.io.IOException;
    import javax.microedition.io.*;
    import java.util.Vector;
    * Class for handle and establish Bluetooth connection
    public class BluetoothConnection extends Thread implements DiscoveryListener
    private StreamConnection sc;
    private DataInputStream input;
    private DataOutputStream output;
    private BluetoothScreen screen;
    private UUID SERIAL = new UUID(0x1101);
    private UUID RFCOMM = new UUID(0x0003);
    private Vector devices, targetDevices;
    private boolean connected;
    private StreamConnection con;
    private ECGDisplay display;
    private int[] transIds;
    private boolean inited, inquiry, search;
    private int count = 0;
    public BluetoothConnection(BluetoothScreen screen, ECGDisplay display)
    this.screen = screen;
    this.display = display;
    devices = new Vector();
    targetDevices = new Vector();
    inited = false;
    * Method for searching and connect to blutooth device with serial port profile
    public boolean searchSerialBT()
    try
    DiscoveryAgent agent = LocalDevice.getLocalDevice().getDiscoveryAgent();
    String url = agent.selectService(SERIAL, ServiceRecord.NOAUTHENTICATE_NOENCRYPT,false);
    if(url!=null)
    con = (StreamConnection)Connector.open(url);
    input = con.openDataInputStream();
    output = con.openDataOutputStream();
    output.writeChars("connected");
    connected = true;
    else
    connected = false;
    catch(Exception e)
    System.out.println(e);
    return connected;
    * Method for establish connection with the connection url which identifies the
    * address of the bluetooth device
    public boolean connect(String conURL)
    try
    con = (StreamConnection)Connector.open(conURL);
    input = con.openDataInputStream();
    output = con.openDataOutputStream();
    output.writeChars("connected");
    connected = true;
    catch(Exception e)
    System.out.println(e);
    return connected;
    * Thread method for handle receiving and displaying of ECG data
    public void run()
    while(true)
    try
    if(input!=null)
    byte[] b = new byte[input.available()];
    input.read(b);
    display.addValues(b);
    Thread.sleep(1);
    catch(IOException e)
    System.out.println(e);
    catch(InterruptedException e)
    System.out.println(e);
    * Method for disconnecting the Bluetooth connection
    public void disconnect()
    try{
    connected = false;
    if(input!=null)
    input.close();
    if(output!=null)
    output.close();
    if(con!=null)
    con.close();
    input = null;
    output = null;
    con = null;
    }catch(IOException e)
    System.out.println(e);
    * Method getting the input stream from the Bluetooth device
    public DataInputStream getInput()
    return input;
    * Method getting the output stream for writing to the Bluetooth device
    public DataOutputStream getOutput()
    return output;
    * Event Handler method for logging the neighbouring bluetooth device
    public void deviceDiscovered(RemoteDevice btDevice, DeviceClass cod)
    devices.addElement(btDevice);
    * method for cancelling the searching of bluetooth devices
    public void cancelSearch()
    try{
    DiscoveryAgent agent = LocalDevice.getLocalDevice().getDiscoveryAgent();
    if(inquiry)
    agent.cancelInquiry(this);
    if(search)
    for(int i=0;i<transIds.length;i++)
    agent.cancelServiceSearch(transIds);
    targetDevices.removeAllElements();
    devices.removeAllElements();
    }catch(BluetoothStateException e)
    System.out.println(e);
    * Method for searching the neighbouring bluetooth devices
    public void searchDevices()
    try
    cancelSearch();
    inquiry = true;
    DiscoveryAgent agent = LocalDevice.getLocalDevice().getDiscoveryAgent();
    agent.startInquiry(DiscoveryAgent.GIAC,this);
    catch(BluetoothStateException e)
    System.out.println(e);
    * Method that indicates the searching of bluetooth devices is completed
    * thus it will proceed to find the device with support of serial port profile from the list
    public void inquiryCompleted(int discType)
    if(discType==INQUIRY_COMPLETED)
    try
    DiscoveryAgent agent = LocalDevice.getLocalDevice().getDiscoveryAgent();
    transIds = new int[devices.size()];
    for (int i=0;i<devices.size();i++)
    RemoteDevice device = (RemoteDevice)devices.elementAt(i);
    transIds[i] = agent.searchServices(new int[]{0x0003}, new UUID[]{SERIAL}, device, this);
    catch(BluetoothStateException e)
    System.out.println(e);
    inquiry = false;
    * Method that indicates the bluetooth devices have the required bluetooth services
    public void servicesDiscovered(int transID, ServiceRecord[] servRecord)
    for(int i=0;i<servRecord.length;i++)
    try
    String[] s = new String[2];
    s[0] = servRecord[i].getHostDevice().getFriendlyName(true);
    s[1] = servRecord[i].getConnectionURL(ServiceRecord.NOAUTHENTICATE_NOENCRYPT,false);
    targetDevices.addElement(s);
    catch(IOException e)
    System.out.println(e);
    * Method to call the screen to display the list of bluetooth devices discovered
    public void serviceSearchCompleted(int transID, int respCode)
    screen.showDevices(targetDevices);

    I have K610i with satellite pro a300-1nt, after it came from service, i can connect to my desktop via bluetooth, but if i try to connect to k610i it says unable to detect remote device. ideas? it says that just on those devices which were registered before (ie, my, sisters phone)
    (EDIT: i cant use cellphone as remote controll, i can only send files to computer.)
    i've tried diagnostics, first passed 2nd failed. i use toshiba's bt stack v7.10.12(T).
    thanx in andvance
    KnE
    Message was edited by: knezan94

  • Cannot find where the issue is, Bluetooth service discovery

    Hi there,
    I am developing a client/server bluetooth messaging application and seem to have to run into a brick wall. I am able to perform a device discovery, and the client is able to locate the server, however I am not able to locate the service on the server even though the server and the client are both using the same UUID and service name.
    It gets to the point where it displays the status message, "Service search initiated" and then it seems like nothing else happens. I have been staring at the code for days and tried all sorts of tinkering, but have been unable to get it to work.
    The UUID and service name I am using is:
    48dd1cf559bb41009d0686f7862d26a2
    serverand below is the code for my class that I implement the device and services discovery in:
    import javax.microedition.io.*;
    import java.util.*;
    import java.io.*;
    import javax.bluetooth.*;
    public class SearchForServices implements DiscoveryListener
        private MessageClient client;
        private String StrUUID; //UUID of service
        private String nameOfService; // Name of service
        private LocalDevice local; //local device
        //Discovery Agent
        private DiscoveryAgent discover;
        //store list of found devices
        private Vector devicesFound;
        //table of matching services/ device name & service Record
        private Hashtable servicesFound;
        private boolean searchComplete;
        private boolean terminateSearch;
        public SearchForServices(MessageClient client, String uuid, String nameOfService)
            //create the discovery listener and then perform device and services search
            this.client = client;
            this.StrUUID = uuid;
            this.nameOfService = nameOfService;
             //create service search data structure
            this.servicesFound = new Hashtable();
            try
                //get discovery agent
                local = LocalDevice.getLocalDevice();
                discover = local.getDiscoveryAgent();
                //create storage for device search
                devicesFound = new Vector();
                //begin search: first devices, then services
                this.client.modifyStatus("Searching for devices...");
                discover.startInquiry(DiscoveryAgent.GIAC, this);
            catch(Exception e)
                this.client.reportError("Unable to perform search");
        /////////////Methods related to the device search called automatically///
        public void deviceDiscovered(RemoteDevice remote, DeviceClass rank)
            // a matching device is found.Only store if it's a PC or phone
            int highRankDevice = rank.getMajorDeviceClass();
            int lowRankDevice = rank.getMinorDeviceClass();
            //restrict devices
            if((highRankDevice == 0x0100) || (highRankDevice == 0x0200))
                devicesFound.addElement(remote);
                this.client.modifyStatus("Device Found");
            else
                this.client.reportError("Matching device not found");
        private String deviceName(RemoteDevice remote)
            String name = null;
            try
                name = remote.getFriendlyName(false);           
            catch(IOException e)
                this.client.modifyStatus("Unable to get Friendly name");
            return name;
        public void inquiryCompleted(int inquiryMode)
            showInquiryStatus(inquiryMode);
            //update status
            this.client.modifyStatus("Number of devices found: " + devicesFound.size());
            // start searching for services
            this.client.modifyStatus("Service search initiated");
            findServices(devicesFound, this.StrUUID);
        private void showInquiryStatus(int inquiryMode)
            if(inquiryMode == INQUIRY_COMPLETED)
                this.client.modifyStatus("Device Search Completed");
            else if(inquiryMode == INQUIRY_TERMINATED)
                this.client.modifyStatus("Device Search Terminated");
            else if(inquiryMode == INQUIRY_ERROR)
                this.client.modifyStatus("Error searching for devices");
        //service search////
        private void findServices(Vector devFound, String strUuid)
            //Perform search for services that have a matching UUID
            //and also check service name
            UUID[] uuids = new UUID[1]; //holds UUIDs for searching       
            //add the one for the service in question
            uuids[0] = new UUID(strUuid, false);
            //to include search for service name attribute
            int[] attributes = new int[1];
            attributes[0] = 0x100;      
            //carry out service search for each device
            //terminate search
            this.terminateSearch = false;
            RemoteDevice xremote;
            for(int i=0; i < devFound.size(); i++)
                xremote = (RemoteDevice)devFound.elementAt(i);
                findService(xremote, attributes, uuids);
                if(terminateSearch)
                    break;
            //report status
            if(servicesFound.size() > 0)
                this.client.displayServices(servicesFound);
            else
                this.client.reportError("No Matching services found");
        private void findService(RemoteDevice remote, int[] attributes, UUID[] uuid)
            try
                int transaction = this.discover.searchServices(attributes, uuid, remote, this);      
                searchFinished(transaction);
            catch(BluetoothStateException e)
        private void searchFinished(int transaction)
            this.searchComplete = false;
            while(!searchComplete)
                synchronized(this)
                    try
                        this.wait();
                    catch(Exception e)
        //below methods called automatically during a search for devices
        public void servicesDiscovered(int transID, ServiceRecord[] records)
            for(int i=0; i < records.length; i++)
                if(records[i] != null)
                    //get service records name
                    DataElement servNameElem = records.getAttributeValue(0x0100);
    String sName = (String)servNameElem.getValue();
    //terminate search
    this.terminateSearch = true;
    if(sName.equals(this.nameOfService)) //check name
    RemoteDevice rem = records[i].getHostDevice();
    servicesFound.put(deviceName(rem), records[i]); //add to hashtable
    public void serviceSearchCompleted(int transID, int respCode)
    //wake up the waiting thread for this search, enabling the next services
    //search to commence
    this.searchComplete = true;
    synchronized(this)
    this.notifyAll();
    After doing abit of troubleshooting, I realised that somehow the client is not able to locate the service on the Server, but I do not understand why that should be so, because the UUID and service name are matching on both the client and the server. It just beats me, and I would appreciate it if a 2nd pair of eyes could have a look at the code. Maybe there is something that I am missing.
    Thanks, I do appreciate..                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

    Hi there,
    I tried a few things such as
    1) Changing the UUID for my application, but that didn't make the system work.
    2) I then went on to modify the implementation and use the selectService() method of the bluetooth class, but still without any luck.
    The only way it works, is if I get the server side to display the connection parameters and I manually enter them into the client side to connect. I do not understand why it is not working the automatic way. I have scanned through my code and logic multiple times, and still cannot figure out what the issue is. :(
    Any help would be appreciated...

  • How do I use a bluetooth headset with garageband?

    How do I use a bluetooth headset with garageband? I can't get it to work after many tries.

    I can pair the headphones with the computer but the sound from GB is distorted and muffled. I can barely hear it. The set works with iTunes, but not with GarageBand.

  • How do i use my Platronix bluetooth with iPhone 4 to listen to music.

    How do i use my Platronix bluetooth with iPhone4 to listen to music.
    Its a mono bluetooth paired with the phone.
    I dont want to buy a new stereo headset but can i use this same one.

    One way is to sync the contacts from the old iPhone to iCloud. Then when you turn on the new phone and set it up for iCloud and turn on the Contacts in Settings >iCloud, they will come to the new phone. http://www.apple.com/icloud/setup/

  • How do I make Iphone proritise answering with bluetooth rather than ringing on phone?.

    Previously, when I received a phone call in my car, the bluetooth radio would ring and then I would take the call by pushing button on steering wheel. Ever since installing latest IOS the bluetooth device connects but the phone just vibrates (doesn't even ring) The radio shuts off but the audio ring does not sound. Have to answer the phone manually. Defeats the purpose of having handsfree!! I note that when I phone voicemail while in car the screen shows options to use bluetooth, Iphone or speaker phone. When I am in the car I JUST want to use handsfree bluetooth (it is the LAW!!). Is this just a glitch in the new operating system update? and if so, when will it be repaired?

    You can't. If iPhoto is open when you connect the phone then it will offer itself from importing.
    Regards
    TD

  • Continuity Bluetooth Calling & SMS on Macbook Pro (via iPhone 5) Not Working

    Devices:
    Macbook Pro Mid-2010 running OSX 10.10.2
    Iphone 5 running iOS 8.1.3
    *NOTE: I understand that due to the version of the Bluetooth protocol in my machine, not all continuity features are available (Handoff, Air Drop, MBP Instant Hotspot)
    However SMS to IMessage and the ability to make and receive calls from my Mac should be OK according to Apple's system requirements one-sheeter:
    System requirements for Continuity on iPhone, iPad, iPod touch, and Mac - Apple Support
    ================================================================================ =====================
    Here's my problem.
    I finally took the plunge last night and updated my iPhone 5 from 7.1 to 8.1.3 to access the iCloud Drive and additional continuity features integrated into Yosemite.
    When I tried to pair my iPhone 5 with my MBP over Bluetooth, all seemed to go well for the first 5 seconds.
    - Both devices were in discovery mode.
    - Mac saw the phone and displayed a security code
    - iPhone displayed the same security code and asked if I would like to pair with MBP
    - Pairing took place. Each devices Bluetooth profile / device showed up in my MBP Bluetooth's Preferences  and in my iPhone's Bluetooth.
    - 5 seconds later, there's no connection between devices.
    My iPhone displays:
    "Connection Unsuccessful: Make sure [Macbook Pro] is turned on and in range." (The phone is 5 inches away)
    Then sometimes I get this message:
    "Connection Unsuccessful: [Macbook Pro] is not supported.
    No rhyme or reason between the two either.
    Here's the baffling part: When I activate my Phone's HotSpot function, the Bluetooth works and connects with my MBP allowing it to use my cell phone network's data for internet connectivity.
    I don't understand what is going on or how to correct this? Can anyone succinctly explain how to correct this problems in layman terms?
    If the devices can communicate long enough to exchange security codes and verify their identities, then use Hotspot,  there is clearly a data exchange happening. Where is the break down taking place when it comes time to stay connected to so I can continue to use the limited continuity features.
    I've seen this question posted before by people having problems with different model years of MBP including the most recents models, so I know it's not mutually exclusive to my model year, but cannot seem to find clarity on an answer.

    Handoff Continuity Troubleshooting
    iPhone, iPad, iPod touch, and Mac using Continuity - Connect

  • How Can I Use Bluetooth For Sharing With iPhones?

    Hello, i have an iPod touch 3rd Gen. 32GB, And I'm Wondering How Could I Share Music or Photos With My Cousin's iPhone (Jailbroken iPhone), When I Turn The Bluetooth On, Nothing Shows Up On My iPod Or On Here iPhone,
    So How Could I Share Things With Her I Have ''File Share'' And ''Bump'' Apps
    So what should I Do???

    You can't share music over air or by Bluetooth because of several reasons of which is understandable by apple. Apple doesn’t provide any way for you to copy files from your iPod back to your Mac/ between iPods or iPhones. While there are legitimate reasons for blocking bi-directional copying— which again the word music piracy comes to the mind
    The only thing that I heard that you could share with iPhone to iPhone/ iPod touch is photos&contacts an app called "bump" and "Bluetooth photo share". With those applications you and your friend can share photos/phone contacts and other kind of files.
    "Bump" application link below:
    http://ax.itunes.apple.com/us/app/bump/id305479724?mt=8&partnerId=30&siteID=Tjuc Fgl1Woc
    "Bluetooth photo share" application link below:
    http://ax.itunes.apple.com/us/app/bluetooth-photo-share/id326109583?mt=8&partner Id=30&siteID=TjucFgl1Woc
    Message was edited by: John-macOwner

  • How can I send stuff from one iPhone to another via Bluetooth?

    How can I send stuff from one iPhone to another via Bluetooth?

    There are some apps that will let you send photos from one iOS device to another over BT.

  • Is there a way to get a log of the bluetooth devices my iphone has been connected to?   My Bluetooth car speaker phone was recently stolen from my car and appears to be on Craigslist.

    Is there any way to get a log of the bluetooth devices my Iphone has been connected to?  I recenly had my Bluetooth Jabra stolen from my car and now a simliar one is on Craigslist.  I'd like to give my connection log to the police before I go and see if my Iphone recognizes the device in question.  Any way to get any type of bluetooth device connection log out of my iphone?

    Your contacts should still be on whatever program you sync your iphone to (i.e. Outlook, address book).
    The iphone is not a stand alone device. It is designed to be synced with a computer. If you have not been syncing with a compatible program, then you are out of luck. Your contacts are not included in the back-up because it is meant to be synced with your computer.
    "Although iTunes backs up most of your iPhone and iPod touch settings, downloaded applications, and other information (Contacts, calendars, notes, images in the Camera Roll), your audio, video, and photo content are not included in the backup."
    http://support.apple.com/kb/HT1414

  • How do I Find/Set/Change a Bluetooth passkey on a T61 laptop with the Lenovo US/Eng Vista OS image?

    I purchased a T61 two years ago. It came with the Lenovo Vista Ultimate OS, US/English.  The T61 has Bluetooth, which I never used until now.
    I try to pair a cell phone and a PDA (both Palm devices) with the T61, and the devices ask for the T61's Bluetooth Passkey. I don't know what the passkey value is, nor do I see anywhere to set, change or enter it.
    This is how I know the the Bluetooth device driver is working on the T61: 1- The BT icon shows in the taskbar, the BT controt panels open, and even in Control Panel > Hardware and Sound > Bluetooth Devices, the phone name shows up. And strangely enough, at the bottom of the control panel, when the phone is listed (is discoverable), it shows "Paired: Yes", "Authenticated: No", attached image shows these values.
    I'm stumped. Where do I lookup, set or change the T61's Bluetooth passkey?

    Unfortunately that is not working. I've tried 0000, 000000, 00000000, 1234, and 123456 as the keys.  No popups, no response whatsoever on the T61. 
    The devices seem to wait some timeout period and then a message "cannot connect to T61...". I don't have the exact message here in front of me, but can get it if need be.

  • Can I use a bluetooth headset as a microphone in iTunes?

    Don't know if this is te right forum but its about iTunes!
    I am very new to all this "wireless" tech being of the old school where everything had a wire attached but thanks to Alexander Traud I now have a phone, headset and two computers all conversing nicely wirelesly.
    So, to the question. I am the aging DJ for our ex-pats club here in Spain and use my white iBook as an iTunes jukebox at home and as the player at the club for my 50's to 70's disco. Its great not having to throw around disks of vinyl anymore and a lot lighter and smaller to carry the record collection too! I was wondering if I could use the BT Motorola H500 headset instead of the wired microphone. I have tried but despite being able to play the iTunes output through the headset (not what I want to do) and the Sound preferences indicate that when I speak I am registering on the input bar I can't get my voice out the headphone output ie. where the main disco amplifier is plugged in.
    Can I do this and if so how please. It seem a shame if you can't.
    TIA
    Mike

    Hi Robert
    Thanks for answering. I didn't know where to post other than the bluetooth forum which is relatively quiet and had no answers forthcoming.
    Yes the voice isn't reaching the amp although it is registering on the input bar in the Sound System Prefs, just won't "play through" as it were. I can't see how it could be done I was just hoping someone might see something I am missing.
    It seems a shame that you can't do it as iTunes on an old iBook makes a good juke box for DJ'ing and with everything becoming wireless these days it seems sensible that you could cut that one last wire.
    Mike

  • Is there a stereo bluetooth headset that can pair with more than one device at a time?

    Is there a stereo bluetooth headset that can pair, i.e. multipoint, with more than one device at a time?
    Are the MacBook and iPhone 4 capable of multipoint bluetooth technoloagy?
    The goal is for my wife to be able to watch her Korean TV soap operas on her MacBook and still receive a call on her iPhone 4 via a stereo bluetooth headset.
    I was looking at the Motorola S10-HD but after further review saw that it only pairs with one device at a time.
    Appreciate any and all input. My Googling has returned no results.
    Rick

    TeslasBB wrote:
    pairing my BB8330 with my blue tooth earphone(TM:jawbone) and my microsoft sync thats in my car simultaneously? if i pair with the car, will i have to pair my jawbone all over again?
    You can only pair one device at a time to your 8330, or any other phone for that matter.  The "pairings" are saved to the phone, you can use one or the other and you won't have to pair it again.  Once you turn your bluetooth device on and the phone is on, they will find each other again.
    Hope this helps,
    John
    Stevie Ray! 1954-1990
    ** Don't forget to resolve your post with the accepted solution.

Maybe you are looking for

  • After upgrading Apache to 2.2.23 there is a problem

    I (perhaps foolishly) upgraded Apache from 2.2.22 to 2.2.23 on OS X Mountain Lion Server. Following the upgrade, remote clients on the LAN cannot access the Web server's default.html.en web page. The DNS entries still look okay on OS X Mountain Lion

  • IPod mini not found by computer

    http://docs.info.apple.com/article.html?artnum=61771 This is the problem I have, but the solution doesn't work. When I get to step 3: "Put your iPod into disk mode and connect it to your computer." But as soon as I plug it it, the iPod screen turns b

  • Convert Date (MM/DD/YYYY) to (Month DD, YYYY)

    Hi, I am looking for a Function Module that converts MM/DD/YYYY to Month DD, YYYY format. For example, 07/27/2009 is to be converted to July 27, 2009. Is there any standard FM that works for this purpose? Please advice. Appreciate Your Help. Thanks,

  • History/ebay sidebar has moved to right hand side, how do i get it back to the left

    Hasn't crashed, haven't changed any settings that i am aware of

  • How to set default 'schema' in Pointbase?

    I am using Netbeans EA2 with bundled appserv. I have tried creating a CMP entity bean from the Pointbase sample database (PBPUBLIC), which works. But when i created my own database (MYDATABASE) in Pointbase and a CMP bean for my test-table, i get a S