Bluetooth MIDlet

Discussion in 'Java' started by Ante, Jul 1, 2003.

  1. Ante

    Ante Guest

    Hi folks!
    I need a tiny midlet that searches for Bluetooth devices in range and
    returns the ID's of the fond devices.
    Has anyone sample code here fore?

    (Obviously thephone itself must be Bluetooth enablend, I know. ;-))

    I know it should be something using the discoveryAgent, but I just
    cannot produce runnable code (i.e. on a Nokia 3650).

    Any ideas?
    Thanks for any comment...
    Ante, Jul 1, 2003
    #1
    1. Advertising

  2. Ante wrote:

    > Hi folks!
    > I need a tiny midlet that searches for Bluetooth devices in range and
    > returns the ID's of the fond devices.
    > Has anyone sample code here fore?


    Take a look at the APIs supplied by JSR-82. From my quick read, it seems
    you want to grab an instance of the javax.bluetooth.DiscoveryAgent for your
    local device:

    LocalDevice ldevice = LocalDevice.getLocalDevice();
    DiscoveryAgent agent = ldevice.getDiscoveryAgent();

    Then, you use the discovery agent to query the PAN for other Blue Tooth
    devices in your vicinity:

    agent.startInquiry(DiscoveryAgent.GIAC,new DiscoveryListener()
    {
    public void deviceDiscovered(RemoteDevice rdevice,DeviceClass clazz)
    {
    // do something with the rdevice object
    }

    // other methods ignored for brevity...
    });

    --
    Darryl L. Pierce <>
    Visit the Infobahn Offramp - <http://bellsouthpwp.net/m/c/mcpierce>
    "What do you care what other people think, Mr. Feynman?"
    Darryl L. Pierce, Jul 1, 2003
    #2
    1. Advertising

  3. Darryl L. Pierce wrote:
    <snip>

    A follow up to the original poster: Does your 3650 support JSR-82? I just
    wrote a quick test MIDlet for both of mine and neither of them support the
    APIs from JSR-82...

    --
    Darryl L. Pierce <>
    Visit the Infobahn Offramp - <http://bellsouthpwp.net/m/c/mcpierce>
    "What do you care what other people think, Mr. Feynman?"
    Darryl L. Pierce, Jul 1, 2003
    #3
  4. Ante wrote:

    > Well this was quite helpfull so far. Thanks!!


    No problem, mate.

    > Could it be that the phone must be MIDP 2.0 comatible to support Java
    > access to the Bluetoth device? Or to put it in other words: Does
    > JSR-82 require the device to be MIDP 2.0 compliant?


    No, there's no such requirement. JSR 82 was completed before the MIDP 2.0
    specification was finalized.

    --
    Darryl L. Pierce <>
    Visit the Infobahn Offramp - <http://bellsouthpwp.net/m/c/mcpierce>
    "What do you care what other people think, Mr. Feynman?"
    Darryl L. Pierce, Jul 2, 2003
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. ScOe

    Re: MIDlet problem

    ScOe, Aug 12, 2003, in forum: Java
    Replies:
    3
    Views:
    428
    Darryl L. Pierce
    Aug 16, 2003
  2. Me
    Replies:
    1
    Views:
    405
    Darryl L. Pierce
    Sep 8, 2003
  3. Paul
    Replies:
    1
    Views:
    313
    Darryl L. Pierce
    Sep 18, 2003
  4. ac
    Replies:
    0
    Views:
    332
  5. izzahmeor
    Replies:
    0
    Views:
    784
    izzahmeor
    Feb 3, 2010
Loading...

Share This Page