J2ME BLUETOOTH

  • Thread starter Eugeniusz Hetmanski
  • Start date
E

Eugeniusz Hetmanski

Hi,
Wher I can found exemple of midlet for client- server aplication based
on Bluetooth(JSR-82)
I want write simple chat client-server based on mobile phones with
Bluetooth. one mobile will server, but others client.
How can I write this???
Thanks
Eugeniusz
 
R

Rob Shepherd

Eugeniusz said:
Hi,
Wher I can found exemple of midlet for client- server aplication based
on Bluetooth(JSR-82)
I want write simple chat client-server based on mobile phones with
Bluetooth. one mobile will server, but others client.
How can I write this???
Thanks
Eugeniusz

Firstly you need a (pair of? ) mobile with a JSR-82 compliant bluetooth host stack....

My ever fading memory informs me that some phones with SymbianOS have this, notably the
Nokia 6600,

Secondly, you may need a J2ME dev kit w/ JSR82 onboard to develop with

The are numerous J2ME and J2SE stacks available for you to play with on a PC, If you have
cash try http://www.atinav.com

if you don't try http://www.javabluetooth.org

There is a good book to be found here http://www.javabluetooth.com

There is also another book by Bala Kumar (i think) The main dude from motorola who sits on
JSR82 commitee...

Why not have a look at the L2CAPPrint server/client code in the examples which come down
with the JSR82 download from Sun JCP.

Have fun

Rob
 
R

Rob Shepherd

Roedy Green said:
Why are these called "stacks"? what does "stack" mean in this context?

OK, JSR-82 is the official Bluetooth API for Java. It is a top level
API to allow Application programmers to write simple bluetooth
applications in Java.. However unlike most other JCP specifications
there is no reference implementation..

Why not? i hear you cry....

Well It's near enough Bluetooth hardware specific, And unlike IP
networking an abstraction is not part of the operating system and so
there is no easy (java.net.* easy..) way of doing it....

If we continue to use the example of IP networking you have hardware
which talks via OS device drivers to the kernel. The kernel also has a
Networking protocol stack which handles the protocol issues that come
with TCP/UDP/IP which App programmers never see... On top of the Stack
is a nice POSIX or otherwise interface so we can make sockets and send
juck down them and then of course there is (in Java) the java.net.*
components which talk through native parts to the OS dependant library
and make it even simpler.... nice.

The term stack takes it name from the ISO/OSI model of an abstract
communications stack -> ie layers of abstraction all stacked up on top
of each other... from high level Application stuff down to Physical
(electromechanical) specifications.

Back to Bluetooth.... Bluetooth too has a communications stack and is
divided between Hardware and Software. Some parts run on the
Bluetooth Chip, and some parts run on the Host (PC/PDA/PhoneCPU/). The
two parts talk accross what is know as the Host Controller Interface
(HCI). this wrt bluetooth is some form of UART (serial
port,USB,Compact flash adapter,PCMCIA adpater).

Because there is no defined means of linking Bluetooth devices to a PC
(or other host CPU) one cannot just trivially add Bluetooth to Java.

JSR-82 provides the java.net.* classes but what is missing is the bit
in the middle (the software stack) or more specfiically
RFCOMM/OBEX/SDP/L2CAP/HCI Bluetooth layers...

The stack is designed to talk to a set or range of devices and built
for each OS /platform. With the case of Serial Port BT devices
Javax.comm already exists to provide native serial comms. Other stack
vendors would have to provide USB drivers or a compact flash interface
or the like...

A JSR-82 compliant stack is a bluetooth stack for java which
(regardless of how it talks to hardware, which components are
implemented and which parts are native or java) Is accessible through
the portable API defined by JSR-82.

This principle can be seen in J2ME with the notion of MIDP. A MIDP
system will provide java MIDP access to things like input and screen
output but if you look at a variety of Java smart phones, the
applications all function the same but underlying implementation id
completely different.

It's not as simple as java.net stuff but at least it provides a common
interface for different implementors to stick too and make platform
independant application writing... This actually goes back to Java's
roots as an embedded Platform Programming environment...

HTH
Ever curious for the Java glossary.
No problem

Rob

---------------------------------------------------------------
| Rob Shepherd
| can be contacted privately through a temporary email account.
| Courtesy of http://www.mailinator.com
|
| (e-mail address removed)
|
| This address will not be checked (by me) after May 31st 2004
---------------------------------------------------------------
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top