Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Bluetooth MIDlet

Reply
Thread Tools

Bluetooth MIDlet

 
 
Ante
Guest
Posts: n/a
 
      07-01-2003
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...
 
Reply With Quote
 
 
 
 
Darryl L. Pierce
Guest
Posts: n/a
 
      07-01-2003
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?"
 
Reply With Quote
 
 
 
 
Darryl L. Pierce
Guest
Posts: n/a
 
      07-01-2003
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?"
 
Reply With Quote
 
Darryl L. Pierce
Guest
Posts: n/a
 
      07-02-2003
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?"
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Bluetooth Adapter for notebook computer...and bluetooth range? John Computer Support 5 07-06-2006 09:02 PM
how to add a bluetooth device on a bluetooth laptop =?Utf-8?B?ZmlmbzYxMQ==?= Wireless Networking 2 07-05-2006 08:53 PM
Bluetake BT009Si Bluetooth USB Adapter and BT400G5 Bluetooth Silverstrand Front Page News 0 09-28-2005 08:25 PM
Logitech Bluetooth headset says I have wrong Bluetooth Stack =?Utf-8?B?U3Byb3h0b24=?= Wireless Networking 0 09-04-2005 10:13 PM
MS Bluetooth dongle + Bluetooth Network Chris Mayhew NZ Computing 6 12-28-2004 08:25 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57