×

Discussion Board

Results 1 to 5 of 5
  1. #1
    Registered User
    Join Date
    Dec 2007
    Posts
    3

    How can i read the bluetooth info on already BT paired devices on J2me phone?

    Hi-

    I have Nokia 9300 phone and the serive provider is T-modile. I am writing a Midlet which connects the bluetooth headset(which paired with my phone) and sends AT commands to the device. Since I already know bluetooth address of the device, i hard coded in the program to connect the device.

    Now I want to read the bluetooth address of the deivce automatically which already paired with the phone. I tried the following methods in the code to get the device info.

    public RemoteDevice[] cachedDevs() {
    RemoteDevice[] r = discoveryAgent.retrieveDevices(DiscoveryAgent.CACHED);
    if( r == null )
    r = new RemoteDevice[0];

    return r;
    }

    /*
    * Retrieve preknown devices.
    * Convenience call for DiscoveryAgent.PREKNOWN
    */
    public RemoteDevice[] preknownDevs() {
    RemoteDevice[] r = discoveryAgent.retrieveDevices(DiscoveryAgent.PREKNOWN);
    if( r == null )
    r = new RemoteDevice[0];

    return r;
    }

    The first method cachedDevs() works after doing one startInquiry call. I am expecting the second method preknownDevs() should work all the time that will give the info about the preknown device which means already paired devices. But it is not working.

    Currently, My midlet is not signed. But It connects to bluetooth devices using JSR-82 API's after the waring window( for unsigned midlet to allow).

    If anybody know why my preknownDevs() method is not returning anything even when it has some devices already paired with.

    Sorry for the long e-mail. I apprciate your time and please help me here if you have any ideas/suggestions.

    thanks,
    Sasikumar.

  2. #2
    Registered User
    Join Date
    Mar 2003
    Posts
    4,105
    Not implemented by Nokia correctly?

  3. #3
    Registered User
    Join Date
    Dec 2007
    Posts
    3

    Re: How can i read the bluetooth info on already BT paired devices on J2me phone?

    Hi Traud-

    Can you please explain me about what is not implemented by nokia correctly? The more info may give me think into different direction. I tried the same application in the nokia e61 phone. That also does the same thing.

    thanks,
    Sasikumar.

  4. #4
    Registered User
    Join Date
    Mar 2003
    Posts
    4,105
    DiscoveryAgent.PREKNOWN?

  5. #5
    Registered User
    Join Date
    Aug 2008
    Location
    Delhi
    Posts
    15

    Question Re: How can i read the bluetooth info on already BT paired devices on J2me phone?

    I am having the similar error on Nokia 5800 (S60 5TH edition).

    I am trying to use the

    Code:
    discoveryAgent.startInquiry(DiscoveryAgent.LIAC, this);
    But for this I get IOexcetion : busy while trying to access the device.

    When I tried to use the

    Code:
    discoveryAgent.retrieveDevices(DiscoveryAgent.PREKNOWN);
    it returns null list

    and

    Code:
    discoveryAgent.retrieveDevices(DiscoveryAgent.CACHED);
    returns list with 0 elements.

    My phone is paired with 5 other devcies.
    -- Vishal Kardode
    http://sites.google.com/site/vishalkardode

Similar Threads

  1. Connecting PC to Mobile Phone Via Bluetooth
    By Sapinou in forum Bluetooth Technology
    Replies: 3
    Last Post: 2011-04-13, 08:19
  2. Bluetooth Phone Requirements
    By saleem145 in forum Bluetooth Technology
    Replies: 1
    Last Post: 2006-09-27, 08:18
  3. unable to find bluetooth devices using j2me
    By vitalmd in forum Bluetooth Technology
    Replies: 0
    Last Post: 2006-02-16, 10:09
  4. J2ME, Bluetooth, Using your Phone as a Gateway???
    By zinomorph in forum Bluetooth Technology
    Replies: 2
    Last Post: 2005-08-26, 13:02
  5. j2me phone can't able to read plain text from servlets - why?
    By mibuyt in forum Mobile Java General
    Replies: 5
    Last Post: 2003-09-29, 13:30

Posting Permissions

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