net.rim.device.api.io.nfc.ndef
Interface NDEFTagConnection

All Superinterfaces:
Connection

public interface NDEFTagConnection
extends Connection

Represents a connection to an NDEF tag. Provides methods to read and write to the tag.

Since:
BlackBerry API 7.0.0

Method Summary
 void append(NDEFMessage msg)
          Appends an NDEF message to the NDEF tag.
 void erase()
          Erases all NDEF messages on the NDEF tag.
 boolean isLocked()
          Indicates whether the NDEF tag is locked.
 void lock()
          Locks the NDEF tag.
 NDEFMessage read()
          Reads an NDEF message from an NDEF tag.
 void write(NDEFMessage msg)
          Writes the NDEF message to the NDEF tag.
 
Methods inherited from interface javax.microedition.io.Connection
close
 



Method Detail

write

void write(NDEFMessage msg)
           throws TagLockedException,
                  NotEnoughSpaceException,
                  NFCException
Writes the NDEF message to the NDEF tag.

Parameters:
msg - The NDEFMessage to be write to the tag.
Throws:
TagLockedException - If the write does not succeed because the tag is locked.
NotEnoughSpaceException - If there is insufficent space on the tag to write the message.
NFCException - When the write operation fails for any other reason.
Since:
BlackBerry API 7.0.0

read

NDEFMessage read()
                 throws NFCException
Reads an NDEF message from an NDEF tag.

Returns:
An NDEFMessage, or null if no NDEF message can be read.
Throws:
NFCException - If a problem occurred while trying to read the NDEFMessage.
Since:
BlackBerry API 7.0.0

append

void append(NDEFMessage msg)
            throws NFCException
Appends an NDEF message to the NDEF tag.

Parameters:
msg - The NDEFMessage to append.
Throws:
NFCException - If append() operation fails.
Since:
BlackBerry API 7.0.0

erase

void erase()
           throws NFCException
Erases all NDEF messages on the NDEF tag.

Throws:
NFCException - If erase() operation fails.
Since:
BlackBerry API 7.0.0

isLocked

boolean isLocked()
                 throws NFCException
Indicates whether the NDEF tag is locked.

Returns:
true if the detected NDEF tag is locked; false otherwise.
Throws:
NFCException - If isLocked() operation fails.
Since:
BlackBerry API 7.0.0

lock

void lock()
          throws NFCException
Locks the NDEF tag.

Throws:
NFCException - If lock() operation fails.
Since:
BlackBerry API 7.0.0





Copyright 1999-2011 Research In Motion Limited. 295 Phillip Street, Waterloo, Ontario, Canada, N2L 3W8. All Rights Reserved.
Java is a trademark of Oracle America Inc. in the US and other countries.
Legal