Bluetooth API and OBEX
What is BluetoothÂ
Bluetooth is a wireless communication protocol mainly used for short distance and in devices with low power consumption. Because Bluetooth is capable of communicating in an omni-directional manner of up to 30 feet at 1 Mb/s it is far superior to infrared. Where infrared requires a distance of a few feet or less and requires a direct line of site for transmissions. Okay what about WiFi, which typical can transmit up to 300 feet at 11 Mb/s. Well the fact is these are really two different beasts; Bluetooth was developed for small data transfers and/or voice communications. Which makes it an excellent candidate for peripherals devices such as wireless microphones, headsets, mice, keyboards and of course mobile handsets. WiFi in general was developed to transmit large amounts of data and to serve as an extension of an existing network such as LAN. Not only does Bluetooth does away with wired cabled connections such as serial, parallel, USB and Fire; but also, it presents to us an unified standard that truly makes connecting to devices to each other ubiquitous. There are hundreds if not thousands ways Bluetooth and be used to enhance our daily lives. Aside from entertainment value of playing games head to head in multiplayer mode there are many business solutions for us to explore
Bluetooth and J2ME
Like other extended APIs/libraries to the J2ME world we have one for To start developing J2ME application/games you can download the Wireless Toolkit 2.2 (currently still Beta at the time of this writing), which includes the JSR 82 and two Bluetooth demos with source code. One of the demos is a picture
sharing program, there isn’t anything special you need to do aside from enabling the JSR 82 API, in the WTK go under the settings and make sure the check box for Bluetooth/OBEX for J2ME (JSR82) is checked off. Afterwards start to instances of the program (one as a slave/client and the other as a master/server) the reset of it is self-explanatory. You will see an image being passed from one device to the other.