javax.microedition.contactless.ndef
Interface NDEFRecordListener


public interface NDEFRecordListener

The NDEFRecordListener provides a mechanism for the application to be notified, when NDEF records are discovered from the contactless targets. The notification is requested based on the NDEF record type on the target. Through this notification the application has a read-only access to the data on the target, but it has no possibility to open a connection to it. Applications must implement this interface to receive the notification.

There can be multiple applications registered to receive notifications about different NDEF records. If this API is implemented on the MIDP 2.x platform, the applications can also request startup based on the NDEF record type on the target with PushRegistry entries. For more information on that, see Appendix B: Launching applications with MIDP 2.x PushRegistry.

The diagram in DiscoveryManager shows what is the relationship of this listener to the TargetListener.

The application is responsible for any possible synchronization required in the listener methods. The listener methods must return quickly and should not perform any extensive processing. The method calls are intended as triggers for the application. The application should do all necessary extensive processing in a separate thread and only use these methods to initiate the processing.


Method Summary
 void recordDetected(NDEFMessage ndefMessage)
          Called by the platform, when the requested NDEF record type is discovered by the device from the contactless target.
 

Method Detail

recordDetected

void recordDetected(NDEFMessage ndefMessage)

Called by the platform, when the requested NDEF record type is discovered by the device from the contactless target. The data is provided to the application in the parameter.

Parameters:
ndefMessage - an NDEFMessage instance containing the data from the target


Copyright © 2004-2009 Nokia Corporation. All Rights Reserved.
Java is a trademark of Sun Microsystems, Inc.