Java Reference
In-Depth Information
Figure 12-4.
Bluetooth dating service running on WTK emulators
You may want to start additional instances of BTMIDlet and BT2 to see how the MIDlet
behaves in a group situation.
Coding the Bluetooth Client
The
DateClient
class contains the code for the Bluetooth client (see Listing 12-1). This client
connects to nearby dating service(s) and writes its own height, sex, and e-mail. This is a
singleton instance, obtained via the static
getInstance()
method. The
startClient()
method
starts a thread and runs the client. The
stopClient()
method terminates the client thread
gracefully. The
setMyInfo()
method is used to set the information that will be written to nearby
dating service(s).
Search WWH ::
Custom Search