Example: Creating a client-server pair using RFCOMM

This example MIDlet shows you how to create a simple client-server pair using the Bluetooth RFCOMM protocol. In this example:

  • The user of the server can send a message to all clients connected to the server.

  • The user of the client can send a message to all clients connected to the server by simply sending a message to the server.

    The server receives messages from any connected client, and "echoes" the received message back to all clients (including the original sender).

Figure: btsppEcho MIDlet

Prerequisites

You need the following to develop and test this MIDlet:

  • Series 40 2nd Edition or S60 2nd Edition FP2 SDK or newer

  • Series 40 2nd Edition or S60 2nd Edition FP2 device or newer

Note: Limited Inquiry Access Code (LIAC) discovery is not supported on Symbian devices. For more information, see the Bluetooth API implementation notes.

For instructions on how to set up the Java ME development environment, see section Setting up the development environment.

Development

For more information about the MIDlet, see:

  • Design for information about the design and functionality of the MIDlet

  • Implementation for information about implementing the MIDlet

You can download the project files for the MIDlet from the download page.