Example: Creating an OBEX connection

This section shows you how to create a simple application for exchanging business cards from scratch and how to run it with an emulator.

A typical scenario of using the application goes as follows: When the MIDlet is started for the first time, the user selects his or her own card from the address book. When two users meet, they start the MIDlet, which exchanges the business cards. New business cards are saved in the phone book on each device.

Note: The device must have at least one contact (business card) in the phone book. Otherwise the MIDlet will not run correctly. The business cards are delivered directly to the application (not to the Inbox). Therefore, sending business cards to a device requires that the BCExchanger MIDlet is running on it.

With the help of this tutorial, you can build the example from scratch and familiarize yourself with some common features related to the OBEX API. Alternatively, you can download the example files and run them immediately with your S60 MIDP SDK (3rd Edition or later). For more information on importing, building, and running Java projects, see Getting Started With Mobile Java section of the JavaTM.

Note: All files in this example application contain the Nokia copyright statement.

Note: The example is also provided on Forum Nokia. Instead of creating the example from scratch as shown in this document, you can download the example files and run them immediately with your SDK.