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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

NDEFRecordNDEFRecord — class in package javax.microedition.contactless.ndefpublic class NDEFRecord extends java.lang.ObjectConstructor summaryNDEFRecord(NDEFRecordType recordType,byte[] id,byte[] payload)NDEFRecord(byte[] data,int offset)Method summaryvoidbyte[]NDEFMessagebyte[]longNDEFRecordTypevoidbyte[]appendPayload(byte[] payload)getId()getNestedNDEFMessage(int offset)getPayload()getPayloadLength()getRecordType()setId(byte[] id)toByteArray()InheritanceDescriptionjava.lang.Object → NDEFRecordMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitThis class represents an NDEF record. An NDEF record consists of type, type format, identifier for the payload and the actualpayload in a byte array. This class is an abstraction of the NDEF record defined by the NFC Forum NDEF specification and ithides some of the fields defined in that specification and leaves them to the <strong>API</strong> implementation. NDEF record may containsubrecords. Nested records can be accessed by getting the record payload and then parsing that payload into new NDEFrecords.A record type gives an identity to the payload in the record. Based on the record type information the application knowsthe meaning of the record payload. This information is used to guide the processing of the payload, like for example inthe application start as described in the appendix B. The type of the first NDEF record inside NDEF message, by convention,should provide the processing context not only for the first record but for the whole NDEF message.The NDEF record also contains an optional identifier for the payload. This identifier may be used to refer to the payload inother records. The value of the ID field is an identifier in the form of a URI RFC (3986). This class provides methods forgetting and setting this identifier. Character encoding used in identifier field must be UTF-8.The chunking feature defined in the NDEF specification must be handled below the Java <strong>API</strong> level. Only complete NDEFrecords are provided to the Java application. This means that the device implementing this <strong>API</strong> should have enough memoryto handle complete NDEF records.33

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

Saved successfully!

Ooh no, something went wrong!