Java Reference
In-Depth Information
CHAPTER 12
■ ■ ■
Bluetooth and OBEX
I nternet on cell phones is all about connecting to things that are a world apart wirelessly.
Interestingly enough, frequently you may wish that you could somehow connect to things
(devices, machines, or even people) that are right next to you. For example, you may be at a
business associate's office, next to a printer that you wish you could use to print an urgent e-mail
you've just received; or you may have walked past your dream house, which happens to be up
for sale, and you want more information on it right away. While the Internet may help in some
situations, it would be wonderful if there were a painless—and ideally airtime free—way for
connecting to things that are next to you.
There is!
Bluetooth is a radio connectivity technology designed for creating Personal Area Networks
(PANs). It is all about connecting to things that are next to you, wirelessly. Java APIs for Bluetooth
is an optional API that adds radio PAN connectivity to MIDP applications.
Other than using radio, some devices can also communicate externally via an infrared
beam. This is especially popular on phones that have built-in PDAs. OBEX, or Object Exchange
Protocol, is a communication protocol that enables applications to talk to one another easily
over infrared (OBEX can actually work over other transport/media as well, such as Bluetooth). The
optional OBEX API contains utility classes that simplify programming using the protocol.
Bluetooth, CLDC, and MIDP
The Bluetooth radio hardware operates in the 2.45-gigahertz Industrial, Scientific, and Medical
(ISM) frequency band, allowing for unlicensed operation worldwide. Bluetooth networks are
formed ad hoc and dynamically, when Bluetooth-enabled devices come into proximity of one
another. Technically, a Bluetooth network is a piconet, and it can consist of one master device
and up to seven slave devices. The number of devices supported can be expanded beyond eight
when a master device on one piconet acts as a slave in another, working as a bridge. However,
all these hardware and radio protocol details are transparent to the application developer
using the Java API for Bluetooth.
Java API for Bluetooth is not included as part of MIDP. It is also not a mandatory part of
JTWI 1.0. Phones that have Bluetooth built in are in the minority, and vendors may expose
proprietary APIs instead of the Java API for Bluetooth (or not expose Java API at all). At this
time, the API is more prevalent with larger PDAs that support the CDC.
Relying only on CLDC 1.0, Java API for Bluetooth can be readily implemented on any
modern devices supporting CLDC, MIDP, and/or JTWI 1.0. It is anticipated that the API will
gain better vendor support in the near future.
195
Search WWH ::




Custom Search