|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectnet.rim.device.api.io.nfc.readerwriter.ReaderWriterManager
public class ReaderWriterManager
Provides methods to allow listeners to register and unregister for events relating to tag detection - this includes targets of a specified or any type, NDEF messages and detection errors.
| Method Summary | ||
|---|---|---|
void |
addDetectionErrorListener(DetectionErrorListener listener)
Registers a listener to receive notifications when an error occurs during target detection. |
|
void |
addDetectionListener(DetectionListener listener)
Registers a listener to receive notifications when the device connects to any type of target. |
|
void |
addDetectionListener(DetectionListener listener,
int[] types)
Registers a listener to receive notifications when the device connects to a specific type of target. |
|
void |
addNDEFMessageListener(NDEFMessageListener listener,
int typeNameFormat,
String recordType)
Registers a listener to receive notifications when an NDEF message is read by the BlackBerry® device. |
|
void |
addNDEFMessageListener(NDEFMessageListener listener,
int typeNameFormat,
String recordType,
boolean autoStart)
Deprecated. |
|
static ReaderWriterManager |
getInstance()
Retrieves an instance of the ReaderWriterManager object, which
provides access to NFC functionality for reading/writing to NFC tags and cards. |
|
void |
removeDetectionErrorListener(DetectionErrorListener listener)
Removes a detection error listener. |
|
void |
removeDetectionListener(DetectionListener listener)
Removes a notification listener. |
|
void |
removeNDEFMessageListener(int typeNameFormat,
String recordType)
Removes an NDEF message notification listener. |
|
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static ReaderWriterManager getInstance()
throws NFCException
ReaderWriterManager object, which
provides access to NFC functionality for reading/writing to NFC tags and cards.
ReaderWriterManager.
SecurityException - If NFC is disabled by an IT policy.
ControlledAccessException - If NFC is disabled by application permissions.
NFCException - If an exception occurs while retrieving the instance.
public void addDetectionListener(DetectionListener listener)
throws NFCException
listener - The DetectionListener to listen for connection detection.
SecurityException - If IT Policy has disallowed NFC or NFC read/write.
ControlledAccessException - If application permissions has disabled read/write.
NFCException
public void addDetectionListener(DetectionListener listener,
int[] types)
throws NFCException
listener - The DetectionListener to listen for
connection detection.types - The types of targets that should trigger notification. Supported targets are Target.NDEF_TAG, Target.ISO_14443_4 and Target.ISO_14443_3.
SecurityException - If an IT policy disallows NFC or NFC read/write.
ControlledAccessException - If read/write is disabled by application permissions.
NFCException
public void removeDetectionListener(DetectionListener listener)
throws NFCException
listener - The object to remove from connection detection notification.
NFCException - When the listener cannot be removed.
public void addDetectionErrorListener(DetectionErrorListener listener)
throws NFCException
listener - The DetectionErrorListener to listen for detection errors.
SecurityException - If IT Policy has disallowed NFC or NFC read/write.
ControlledAccessException - If application permissions has disabled read/write.
NFCException
public void removeDetectionErrorListener(DetectionErrorListener listener)
throws NFCException
listener - The detection error notification listener to remove.
NFCException - When the listener cannot be removed.
public void addNDEFMessageListener(NDEFMessageListener listener,
int typeNameFormat,
String recordType)
throws NFCException
listener - The NDEFMessageListener object.typeNameFormat - An NDEF type name format.recordType - An NDEF record types.
NFCException - When the listener cannot be added.
SecurityException - If an IT policy disallows NFC or NFC read/write.
ControlledAccessException - If read/write is disabled by application permissions.
public void addNDEFMessageListener(NDEFMessageListener listener,
int typeNameFormat,
String recordType,
boolean autoStart)
throws NFCException
listener - The NDEFMessageListener object.typeNameFormat - An NDEF type name format.recordType - An NDEF record types.autoStart - Indicates whether the application should be started if not running.
NFCException - When the listener cannot be added.
SecurityException - If an IT policy disallows NFC or NFC read/write.
ControlledAccessException - If read/write is disabled by application permissions.
public void removeNDEFMessageListener(int typeNameFormat,
String recordType)
throws NFCException
typeNameFormat - An NDEF type name format.recordType - One of NDEF record types.
NFCException - When the listener cannot be removed.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
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