|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectnet.rim.device.api.io.nfc.NFCManager
public final class NFCManager
Manages the status of NFC on the device. Allows registration and removal
of NFCStatusListener and NFCFieldListener objects. Also provides
functionality to determine the currently available or enabled NFC services and the
ability to enable NFC on the device. This manager also provides methods
to play a generic tone when NFC operations are completed.
| Field Summary | ||
|---|---|---|
static int |
NFC_ALL
Constant that indicates all NFC features. |
|
static int |
NFC_EMBEDDED_SECURE_ELEMENT_CARD_EMULATION
Constant that identifies NFC embedded secure element card emulation. |
|
static int |
NFC_EMBEDDED_SECURE_ELEMENT_CARD_EMULATION_PERSISTENT
Constant that identifies NFC embedded secure element card emulation persistent setting. |
|
static int |
NFC_NONE
Constant that indicates no NFC service is available. |
|
static int |
NFC_TAG_CARD_EMULATION
Constant that identifies NFC tag or card emulation (non-Secure Element). |
|
static int |
NFC_TAG_CARD_READER_WRITER
Constant that indicates an NFC card reader or writer. |
|
static int |
NFC_UICC_CARD_EMULATION
Constant that identifies NFC UICC SIM secure element card emulation. |
|
static int |
NFC_UICC_CARD_EMULATION_PERSISTENT
Constant that identifies NFC UICC SIM secure element card emulation persistent setting. |
|
| Method Summary | ||
|---|---|---|
void |
addNFCFieldListener(NFCFieldListener listener)
Registers an NFCFieldListener object to receive notifications
when NFC detects field changes. |
|
static void |
addNFCStatusListener(NFCStatusListener listener)
Registers an NFCStatusListener to receive notifications when
NFC services are enabled or disabled. |
|
void |
doNFCDataTransferAlert()
Provides a uniform alert to indicate that NFC data transfer is complete, and the device can be moved out of NFC range. |
|
void |
enableNFCByPrompt()
If NFC is disabled, a dialog prompt is displayed asking if the user would like to enable NFC. |
|
int |
getAvailableNFCServices()
Gets the NFC service mask for NFC services that are currently available to this application. |
|
int |
getEnabledNFCServices()
Retrieves the state of NFC functionality. |
|
static NFCManager |
getInstance()
Retrieves an instance of the NFCManager object, which
provides access to NFC status functionality. |
|
void |
playNFCOperationFailureSound()
Plays the NFC operation failure sound if alerts are permitted by the current profile. |
|
void |
playNFCOperationSuccessSound()
Plays the NFC operation success sound if alerts are permitted by the current profile. |
|
void |
removeNFCFieldListener(NFCFieldListener listener)
Removes a registered NFCFieldListener. |
|
static boolean |
removeNFCStatusListener(NFCStatusListener listener)
Removes an NFCStatusListener. |
|
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int NFC_EMBEDDED_SECURE_ELEMENT_CARD_EMULATION
public static final int NFC_UICC_CARD_EMULATION
public static final int NFC_TAG_CARD_EMULATION
public static final int NFC_TAG_CARD_READER_WRITER
public static final int NFC_EMBEDDED_SECURE_ELEMENT_CARD_EMULATION_PERSISTENT
public static final int NFC_UICC_CARD_EMULATION_PERSISTENT
public static final int NFC_ALL
public static final int NFC_NONE
| Method Detail |
|---|
public static NFCManager getInstance()
throws NFCException
NFCManager object, which
provides access to NFC status functionality.
NFCManager.
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 int getEnabledNFCServices()
throws NFCException
NFCException - If the application cannot retrieve the enabled services.
public int getAvailableNFCServices()
throws NFCException
NFCException - If the application cannot retrieve the available services.
public static void addNFCStatusListener(NFCStatusListener listener)
throws NFCException
NFCStatusListener to receive notifications when
NFC services are enabled or disabled.
listener - The listener object to notify when NFC service availability changes. If
the listener was previously registered, this method does
nothing.
IllegalArgumentException - If NFCStatusListener is null.
NFCException - If there is a problem adding the listener object.
public static boolean removeNFCStatusListener(NFCStatusListener listener)
throws NFCException
listener is null,
removeNFCStatusListener returns false.
listener - The registered listener object to remove.
true if the NFC status listener was removed;
false if it wasn't found.
NFCException - If the listener cannot be removed successfully.public void doNFCDataTransferAlert()
public void playNFCOperationSuccessSound()
public void playNFCOperationFailureSound()
public void addNFCFieldListener(NFCFieldListener listener)
throws NFCException
NFCFieldListener object to receive notifications
when NFC detects field changes.
listener - The listener object to receive notifications when NFC detects field changes.
NFCException - If NFC field listener cannot be added.
public void removeNFCFieldListener(NFCFieldListener listener)
throws NFCException
NFCFieldListener.
listener - The listener that was added to receive notifications when NFC detects field changes.
NFCException - If NFC field listener cannot be removed.
public void enableNFCByPrompt()
throws NFCException
NFCException - If there is an issue while trying to enable NFC
|
|||||||||
| 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