×

Discussion Board

Results 1 to 3 of 3
  1. #1
    Registered User
    Join Date
    Jul 2008
    Posts
    13

    Bluetooth Connection Problem

    Hi everyone,
    I am making one bluetooth application. I am able to get the devices around me.But i am not able to connect to those devices.below is some part of code.

    ******************commandAction of MIDlet**********************
    if(d==deviceList && cmd==connect){
    (new Thread(new ConnectServices(this))).start();
    }
    *********************ConnectServices class*********************
    public class ConnectServices implements Runnable {

    private HelloMIDlet midlet;
    private Alert showException;

    public ConnectServices(HelloMIDlet midlet){
    this.midlet=midlet;
    }

    public void run() {

    try {
    for(int counter=0;counter<this.midlet.devices.size();counter++)
    { this.midlet.getDiscoveryAgent().searchServices(null,this.midlet.uuidArray,(RemoteDevice)this.midlet.devices.elementAt(counter), this.midlet);
    try {Thread.sleep(1000);} catch (InterruptedException ex) {}
    }
    this.midlet.searchForm.append("serviceSearch DONE.");
    }catch (IOException ex) {}

    }
    ******************MIDlet code*********************************
    METHOD -1
    public void deviceDiscovered(RemoteDevice remoteDevice, DeviceClass device) {
    devices.addElement(remoteDevice);
    // other code....
    }
    METHOD -2
    public void inquiryCompleted(int discType) { }
    METHOD - 3
    public void servicesDiscovered(int paramInt, ServiceRecord[] serviceRecords) {
    searchForm.append("service found\nlength:"+serviceRecords.length);
    /// other code....
    }
    METHOD-4
    public void serviceSearchCompleted(int transID, int resCode) {
    this.searchForm.append("serviceSearchCompleted called");
    /// other code...
    }
    METHOD 1,2 and 4 works perfectly
    BUT METHOD-3 is not even getting called.

    can anyone please help me out.

    Regards,
    Sandeep Gadhvi.

  2. #2
    Nokia Developer Expert
    Join Date
    Aug 2007
    Posts
    1,595

    Re: Bluetooth Connection Problem

    Hello sandeepsandeep,

    check whether these Known Issues produce any solution for your issue:

    http://wiki.forum.nokia.com/index.ph...llback_methods

    http://wiki.forum.nokia.com/index.ph...tring_value%3F

    Regards,
    r2j7
    [URL="http://library.forum.nokia.com/java"][B] >>> Java Developer's Library <<<[/B][/URL]
    [URL="https://www.developer.nokia.com/Resources/Support/Technical_support.xhtml"] [B]>>> Technical Support for Java ME development <<<[/B][/URL]
    [URL="https://publish.ovi.com/info/"][B]>>> Nokia Publish: reach millions of Nokia users worldwide through Nokia Store <<<[/B][/URL]

  3. #3
    Registered User
    Join Date
    Mar 2003
    Posts
    4,105
    this.midlet.uuidArray = { new UUID(0x1101L) };
    Or what UUID are you looking for?

Similar Threads

  1. Closing a bluetooth connection
    By Alfury in forum Mobile Java Networking & Messaging & Security
    Replies: 4
    Last Post: 2008-04-01, 16:18
  2. Bluetooth connection problem
    By GameTrax in forum Symbian Networking & Messaging (Closed)
    Replies: 0
    Last Post: 2006-12-08, 16:42
  3. Nokia 3250 Bluetooth Connection Problem
    By TalJ in forum Symbian Networking & Messaging (Closed)
    Replies: 2
    Last Post: 2006-06-27, 07:32
  4. Bluetooth serial connection timeout
    By martin.ericsson in forum General Development Questions
    Replies: 0
    Last Post: 2005-06-13, 02:00
  5. Problem with Serial port connection using Nokia6600 Bluetooth
    By mandykahlon in forum General Development Questions
    Replies: 1
    Last Post: 2005-05-31, 11:42

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×