|
Android 2.3 Gingerbread | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectandroid.nfc.NfcAdapter
public final class NfcAdapter
Represents the device's local NFC adapter.
Use the static getDefaultAdapter() method to get the default NFC
Adapter for this Android device. Most Android devices will have only one NFC
Adapter, and getDefaultAdapter() returns the singleton object.
| Field Summary | |
|---|---|
static String |
ACTION_ADAPTER_STATE_CHANGE
Broadcast Action: an adapter's state changed between enabled and disabled. |
static String |
ACTION_LLCP_LINK_STATE_CHANGED
Broadcast Action: the LLCP link state changed. |
static String |
ACTION_TAG_DISCOVERED
Intent to start an activity when a tag is discovered. |
static String |
ACTION_TRANSACTION_DETECTED
Broadcast Action: a transaction with a secure element has been detected. |
static String |
EXTRA_AID
Mandatory byte array extra field in ACTION_TRANSACTION_DETECTED. |
static String |
EXTRA_ID
Optional byte[] extra for the tag identifier. |
static String |
EXTRA_LLCP_LINK_STATE_CHANGED
Used as int extra field in ACTION_LLCP_LINK_STATE_CHANGED. |
static String |
EXTRA_NDEF_MESSAGES
Optional NdefMessage[] extra for the ACTION_TAG intents. |
static String |
EXTRA_NEW_BOOLEAN_STATE
The Intent extra for ACTION_ADAPTER_STATE_CHANGE, saying what the new state is. |
static String |
EXTRA_TAG
Mandatory Tag extra for the ACTION_TAG intents. |
static int |
LLCP_LINK_STATE_ACTIVATED
LLCP link status: The LLCP link is activated. |
static int |
LLCP_LINK_STATE_DEACTIVATED
LLCP link status: The LLCP link is deactivated. |
(package private) android.nfc.INfcAdapter |
mService
|
| Method Summary | |
|---|---|
(package private) void |
attemptDeadServiceRecovery(Exception e)
NFC service dead - attempt best effort recovery |
NdefTagConnection |
createNdefTagConnection(NdefTag tag)
Create an NDEF tag connection to the default Target |
NdefTagConnection |
createNdefTagConnection(NdefTag tag,
String target)
Create an NDEF tag connection to the specified Target |
RawTagConnection |
createRawTagConnection(Tag tag)
Create a raw tag connection to the default Target |
RawTagConnection |
createRawTagConnection(Tag tag,
String target)
Create a raw tag connection to the specified Target |
boolean |
disable()
Disable NFC hardware. |
boolean |
enable()
Enable NFC hardware. |
static NfcAdapter |
getDefaultAdapter()
Get a handle to the default NFC Adapter on this Android device. |
boolean |
isEnabled()
Return true if this NFC Adapter has any features enabled. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String ACTION_TAG_DISCOVERED
public static final String EXTRA_TAG
public static final String EXTRA_NDEF_MESSAGES
public static final String EXTRA_ID
public static final String ACTION_TRANSACTION_DETECTED
Always contains the extra field
EXTRA_AID
public static final String ACTION_ADAPTER_STATE_CHANGE
public static final String EXTRA_NEW_BOOLEAN_STATE
public static final String EXTRA_AID
ACTION_TRANSACTION_DETECTED.
Contains the AID of the applet involved in the transaction.
public static final int LLCP_LINK_STATE_ACTIVATED
public static final int LLCP_LINK_STATE_DEACTIVATED
public static final String ACTION_LLCP_LINK_STATE_CHANGED
Always contains the extra field
EXTRA_LLCP_LINK_STATE_CHANGED.
public static final String EXTRA_LLCP_LINK_STATE_CHANGED
ACTION_LLCP_LINK_STATE_CHANGED.
It contains the new state of the LLCP link.
android.nfc.INfcAdapter mService
| Method Detail |
|---|
public static NfcAdapter getDefaultAdapter()
Most Android devices will only have one NFC Adapter (NFC Controller).
void attemptDeadServiceRecovery(Exception e)
public boolean isEnabled()
If this method returns false, then applications should request the user turn on NFC tag discovery in Settings.
If this method returns false, the NFC hardware is guaranteed not to perform or respond to any NFC communication.
public boolean enable()
NOTE: may block for ~second or more. Poor API. Avoid calling from the UI thread.
public boolean disable()
NOTE: may block for ~second or more. Poor API. Avoid calling from the UI thread.
public RawTagConnection createRawTagConnection(Tag tag)
Requires Manifest.permission.NFC permission.
public RawTagConnection createRawTagConnection(Tag tag,
String target)
Requires Manifest.permission.NFC permission.
public NdefTagConnection createNdefTagConnection(NdefTag tag)
Requires Manifest.permission.NFC permission.
public NdefTagConnection createNdefTagConnection(NdefTag tag,
String target)
Requires Manifest.permission.NFC permission.
|
Android 2.3 Gingerbread | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||