Example usage for Java android.nfc NdefRecord fields, constructors, methods, implement or subclass
The text is from its open source code.
short | TNF_WELL_KNOWN Indicates the type field contains a well-known RTD type name. Use this tnf with RTD types such as #RTD_TEXT , #RTD_URI . |
short | TNF_MIME_MEDIA Indicates the type field contains a media-type BNF construct, defined by RFC 2046. Use this with MIME type names such as "image/jpeg" , or using the helper #createMime . |
short | TNF_ABSOLUTE_URI Indicates the type field contains an absolute-URI BNF construct defined by RFC 3986. When creating new records prefer #createUri , since it offers more compact URI encoding ( #RTD_URI allows compression of common URI prefixes). |
short | TNF_EXTERNAL_TYPE Indicates the type field contains an external type name. Used to encode custom payloads. |
short | TNF_UNKNOWN Indicates the payload type is unknown. NFC Forum explains this should be treated similarly to the "application/octet-stream" MIME type. |
null | RTD_TEXT RTD Text type. |
null | RTD_URI RTD URI type. |
null | RTD_HANDOVER_REQUEST RTD Handover Request type. |
NdefRecord(short tnf, byte[] type, byte[] id, byte[] payload) Construct an NDEF Record from its component fields. Recommend to use helpers such as {#createUri} or { #createExternal where possible, since they perform stricter validation that the record is correctly formatted as per NDEF specifications. |
NdefRecord | createApplicationRecord(String packageName) Create a new Android Application Record (AAR). |
NdefRecord | createExternal(String domain, String type, byte[] data) Create a new NDEF Record containing external (application-specific) data. Use this method to encode application specific data into an NDEF Record. |
NdefRecord | createMime(String mimeType, byte[] mimeData) Create a new NDEF Record containing MIME data. Use this method to encode MIME-typed data into an NDEF Record, such as "text/plain", or "image/jpeg". The mimeType parameter will be normalized with Intent#normalizeMimeType to follow Android best practices for intent filtering, for example to force lower-case. |
NdefRecord | createUri(Uri uri) Create a new NDEF Record containing a URI. Use this method to encode a URI (or URL) into an NDEF Record. Uses the well known URI type representation: #TNF_WELL_KNOWN and #RTD_URI . |
NdefRecord | createUri(String uriString) Create a new NDEF Record containing a URI. Use this method to encode a URI (or URL) into an NDEF Record. Uses the well known URI type representation: #TNF_WELL_KNOWN and #RTD_URI . |
byte[] | getId() Returns the variable length ID. |
byte[] | getPayload() Returns the variable length payload. |
short | getTnf() Returns the 3-bit TNF. |
byte[] | getType() Returns the variable length Type field. |
byte[] | toByteArray() Return this NDEF Record as a byte array. This method is deprecated, use NdefMessage#toByteArray instead. |
String | toString() |
Uri | toUri() Map this record to a URI, or return null if it cannot be mapped. Currently this method considers the following to be URI records:
|