?? readme.txt
字號:
Chapter B1. An Echoing Client/Server Application Using Bluetooth
From:
Killer Game Programming in Java
Dr. Andrew Davison
Dept. of Computer Engineering
Prince of Songkla University
Hat Yai, Songkhla 90112, Thailand
E-mail: ad@fivedots.coe.psu.ac.th
Web Site for the book: http://fivedots.coe.psu.ac.th/~ad/jg
If you use this code, please mention my name, and include a link
to the book's Web site.
**NOTE**: this example is NOT in the hardcopy book printed by O'Reilly.
Thanks,
Andrew
============================
This example is a client/server application using the
Bluetooth API in JSR 82, which is available in version 2.2.
of the J2ME Wireless Toolkit (WTK22). It can be downloaded from
http://java.sun.com/products/j2mewtoolkit/
Since it's a client/server example, there are two MIDlets --
the server code is in the EchoServerMIDlet\ directory,
the client code in EchoClientMIDlet\.
============================
The Server-side (in EchoServerMIDlet\)
The Echo Server MIDlet consists of 5 Java files:
EchoServerMIDlet.java, ScrollableMessagesBox.java,
KeyRepeatTask.java, EchoServer.java,
ThreadedEchoHandler.java
------
Server Compilation and Execution (using WTK22's KToolbar)
Create a new project called EchoServerMIDlet, with the MIDlet
class name EchoServerMIDlet.
Make sure to select the "Bluetooth/OBEX for J2ME (JSR 82)" API
in the project's API settings.
Copy the Java files to WTK22\apps\EchoServerMIDlet\src\
Build and run (but see "Server Notes" below)
------
Server Notes
Since many clients will be connected to the server, it may be necessary
to increase the Bluetooth "bluetooth.connected.devices.max" setting
which specifies the maximum number of connections to a device.
WTK22's value for "bluetooth.connected.devices.max"
can be set in the "System Properties" tab of the "Bluetooth/OBEX" tab
in the "Preferences" menu. Increase it to 3 to allow a maximum of
three clients to be connected to the server at once.
============================
The Client-side (in EchoClientMIDlet\)
The Echo Client MIDlet consists of 5 Java files:
EchoClientMIDlet.java, ServiceFinder.java, ServicesList.java,
ClientForm.java, EchoClient.java
------
Client Compilation and Execution (using WTK22's KToolbar)
Create a new project called EchoClientMIDlet, with the MIDlet
class name EchoClientMIDlet.
Make sure to select the "Bluetooth/OBEX for J2ME (JSR 82)" API
in the project's API settings.
Copy the Java files to WTK22\apps\EchoClientMIDlet\src\
Build and run (but see "Client Notes" below)
------
Client Notes
Start the server before starting any clients.
Client MIDlets should be run in a separate invocation of
WTK22 from the server MIDlet.
I've only been able to start a maximum of two clients before
socket, security, or JSR 82 initialization errors occur.
When a problem appears, the WTK22 invocations for the
client _and_ server need to be restarted.
---------
Last updated: 2nd September 2005
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -