11.07.2015 Views

Contactless Communication API - Oracle Software Delivery Cloud

Contactless Communication API - Oracle Software Delivery Cloud

Contactless Communication API - Oracle Software Delivery Cloud

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

NDEFRecordListenerNDEFRecordListener — interface in package javax.microedition.contactless.ndefpublic interface NDEFRecordListenerMethod summaryvoidrecordDetected(NDEFMessage ndefMessage)DescriptionMethodsThe NDEFRecordListener provides a mechanism for the application to be notified, when NDEF records are discoveredfrom the contactless targets. The notification is requested based on the NDEF record type on the target. Through thisnotification the application has a read-only access to the data on the target, but it has no possibility to open a connectionto 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 <strong>API</strong> is implementedon the MIDP 2.x platform, the applications can also request startup based on the NDEF record type on the target withPushRegistry 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 methodsmust return quickly and should not perform any extensive processing. The method calls are intended as triggers for theapplication. The application should do all necessary extensive processing in a separate thread and only use these methodsto initiate the processing.recordDetected( NDEFMessage )public void recordDetected( NDEFMessagendefMessage)ParametersCalled by the platform, when the requested NDEF record type is discovered by the device from the contactless target. Thedata is provided to the application in the parameter.ndefMessage - an NDEFMessage instance containing the data from the target37

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!