v7.1 [23 Nov 2011]
BlackBerry Java SDK 7.1
This page lists new features for the BlackBerry Java SDK 7.1.
For BlackBerry Java SDKBlackBerry Java SDK 7.1, the documentation is moved into the format you are now viewing.
Documentation for earlier versions is still available at the old location, Java Development Guides and API Reference. (Use the version dropdown list to open earlier versions.)
Near Field Communication (NFC)
You can use the LLCPConnection and LLCPConnectionNotifier interfaces in the net.rim.device.api.io.nfc.llcp package to open a client or server connection with another NFC-enabled device.
To communicate with an NFC peer as a client, open a connection using the java.microedition.io.Connector.open() method. Cast the returned object as an LLCPConnection to retrieve the input and output streams for the connection.
In your connection string, you can define the service name or service access point for the connection. If you choose to use a service access point for your application, you should check whether the NFC Forum has reserved the service access point number.
To communicate with an NFC peer as a server, you can retrieve a Connection object using the LLCPConnectionNotifier interface. When you are ready to listen for a connection request, you can invoke LLCPConnectionNotifier.acceptAndOpen().
Simple NDEF Exchange Protocol
You can respond to NDEF push requests that use the Simple NDEF Exchange Protocol (SNEP) using the classes and interfaces in the net.rim.device.api.io.nfc.push package. When the BlackBerry device detects a SNEP request, it notifies any applications that registered interest in responding. Implement the NDEFMessageBuilder interface to create an NDEF message when a request arrives, and register your implementation using the NDEFPushManager class.
The device also notifies applications about the status of push requests. To receive status notifications, implement and register the NDEFPushStatusCallback using NDEFPushManager.
You can register for notification of connection handover events using the classes and interfaces in the net.rim.device.api.io.nfc.handover package. Only Bluetooth connection handovers are supported in the BlackBerry Java SDK 7.1.
A connection handover event begins when the device detects a smart tag that contains Bluetooth pairing information. The device negotiates a Bluetooth connection and passes the connection details to any applications that registered a ConnectionHandoverListener implementation. You can register a listener using the ConnectionHandoverManager class.