# NfcAdapter

Added in[API level 9](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  
Summary:[Nested Classes](https://developer.android.com/reference/android/nfc/NfcAdapter#nestedclasses)\|[Constants](https://developer.android.com/reference/android/nfc/NfcAdapter#constants)\|[Methods](https://developer.android.com/reference/android/nfc/NfcAdapter#pubmethods)\|[Inherited Methods](https://developer.android.com/reference/android/nfc/NfcAdapter#inhmethods)  

# NfcAdapter

*** ** * ** ***

[Kotlin](https://developer.android.com/reference/kotlin/android/nfc/NfcAdapter "View this page in Kotlin")\|Java

`
public

final

class
NfcAdapter
`  
`

extends `[Object](https://developer.android.com/reference/java/lang/Object)`


``


`

|---|------------------------|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object) ||
| ↳ | android.nfc.NfcAdapter |

<br />

*** ** * ** ***

Represents the local NFC adapter.

Use the helper[getDefaultAdapter(android.content.Context)](https://developer.android.com/reference/android/nfc/NfcAdapter#getDefaultAdapter(android.content.Context))to get the default NFC adapter for this Android device.  

### Developer Guides

For more information about using NFC, read the[Near Field Communication](https://developer.android.com/guide/topics/nfc)developer guide.

To perform basic file sharing between devices, read[Sharing Files with NFC](https://developer.android.com/training/beam-files).

<br />

## Summary

|                                                                                                                                   ### Nested classes                                                                                                                                    ||
|--------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ` interface` | [NfcAdapter.CreateBeamUrisCallback](https://developer.android.com/reference/android/nfc/NfcAdapter.CreateBeamUrisCallback) *This interface was deprecated in API level 29. this feature is removed. File sharing can work using other technology like Bluetooth.*         |
| ` interface` | [NfcAdapter.CreateNdefMessageCallback](https://developer.android.com/reference/android/nfc/NfcAdapter.CreateNdefMessageCallback) *This interface was deprecated in API level 29. this feature is removed. File sharing can work using other technology like Bluetooth.*   |
| ` interface` | [NfcAdapter.OnNdefPushCompleteCallback](https://developer.android.com/reference/android/nfc/NfcAdapter.OnNdefPushCompleteCallback) *This interface was deprecated in API level 29. this feature is removed. File sharing can work using other technology like Bluetooth.* |
| ` interface` | [NfcAdapter.OnTagRemovedListener](https://developer.android.com/reference/android/nfc/NfcAdapter.OnTagRemovedListener) A callback that is invoked when a tag is removed from the field.                                                                                   |
| ` interface` | [NfcAdapter.ReaderCallback](https://developer.android.com/reference/android/nfc/NfcAdapter.ReaderCallback) A callback to be invoked when the system finds a tag while the foreground activity is operating in reader mode.                                                |

|                                                                                                                                                                                                                                                                                                               ### Constants                                                                                                                                                                                                                                                                                                                ||
|--------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [String](https://developer.android.com/reference/java/lang/String) | [ACTION_ADAPTER_STATE_CHANGED](https://developer.android.com/reference/android/nfc/NfcAdapter#ACTION_ADAPTER_STATE_CHANGED) Broadcast Action: The state of the local NFC adapter has been changed.                                                                                                                                                                                                                                                                                                                                                                     |
| [String](https://developer.android.com/reference/java/lang/String) | [ACTION_CHANGE_TAG_INTENT_PREFERENCE](https://developer.android.com/reference/android/nfc/NfcAdapter#ACTION_CHANGE_TAG_INTENT_PREFERENCE) Activity action: Bring up the settings page that allows the user to enable or disable tag intent reception for apps.                                                                                                                                                                                                                                                                                                         |
| [String](https://developer.android.com/reference/java/lang/String) | [ACTION_NDEF_DISCOVERED](https://developer.android.com/reference/android/nfc/NfcAdapter#ACTION_NDEF_DISCOVERED) Intent to start an activity when a tag with NDEF payload is discovered.                                                                                                                                                                                                                                                                                                                                                                                |
| [String](https://developer.android.com/reference/java/lang/String) | [ACTION_PREFERRED_PAYMENT_CHANGED](https://developer.android.com/reference/android/nfc/NfcAdapter#ACTION_PREFERRED_PAYMENT_CHANGED) Broadcast Action: Intent to notify if the preferred payment service changed.                                                                                                                                                                                                                                                                                                                                                       |
| [String](https://developer.android.com/reference/java/lang/String) | [ACTION_TAG_DISCOVERED](https://developer.android.com/reference/android/nfc/NfcAdapter#ACTION_TAG_DISCOVERED) Intent to start an activity when a tag is discovered.                                                                                                                                                                                                                                                                                                                                                                                                    |
| [String](https://developer.android.com/reference/java/lang/String) | [ACTION_TECH_DISCOVERED](https://developer.android.com/reference/android/nfc/NfcAdapter#ACTION_TECH_DISCOVERED) Intent to start an activity when a tag is discovered and activities are registered for the specific technologies on the tag.                                                                                                                                                                                                                                                                                                                           |
| [String](https://developer.android.com/reference/java/lang/String) | [ACTION_TRANSACTION_DETECTED](https://developer.android.com/reference/android/nfc/NfcAdapter#ACTION_TRANSACTION_DETECTED) Broadcast Action: Intent to notify an application that a transaction event has occurred on the Secure Element.                                                                                                                                                                                                                                                                                                                               |
| [String](https://developer.android.com/reference/java/lang/String) | [EXTRA_ADAPTER_STATE](https://developer.android.com/reference/android/nfc/NfcAdapter#EXTRA_ADAPTER_STATE) Used as an int extra field in[ACTION_ADAPTER_STATE_CHANGED](https://developer.android.com/reference/android/nfc/NfcAdapter#ACTION_ADAPTER_STATE_CHANGED)intents to request the current power state.                                                                                                                                                                                                                                                          |
| [String](https://developer.android.com/reference/java/lang/String) | [EXTRA_AID](https://developer.android.com/reference/android/nfc/NfcAdapter#EXTRA_AID) Mandatory byte\[\] extra field in[ACTION_TRANSACTION_DETECTED](https://developer.android.com/reference/android/nfc/NfcAdapter#ACTION_TRANSACTION_DETECTED)                                                                                                                                                                                                                                                                                                                       |
| [String](https://developer.android.com/reference/java/lang/String) | [EXTRA_DATA](https://developer.android.com/reference/android/nfc/NfcAdapter#EXTRA_DATA) Optional byte\[\] extra field in[ACTION_TRANSACTION_DETECTED](https://developer.android.com/reference/android/nfc/NfcAdapter#ACTION_TRANSACTION_DETECTED)                                                                                                                                                                                                                                                                                                                      |
| [String](https://developer.android.com/reference/java/lang/String) | [EXTRA_ID](https://developer.android.com/reference/android/nfc/NfcAdapter#EXTRA_ID) Optional extra containing a byte array containing the ID of the discovered tag for the[ACTION_NDEF_DISCOVERED](https://developer.android.com/reference/android/nfc/NfcAdapter#ACTION_NDEF_DISCOVERED),[ACTION_TECH_DISCOVERED](https://developer.android.com/reference/android/nfc/NfcAdapter#ACTION_TECH_DISCOVERED), and[ACTION_TAG_DISCOVERED](https://developer.android.com/reference/android/nfc/NfcAdapter#ACTION_TAG_DISCOVERED)intents.                                    |
| [String](https://developer.android.com/reference/java/lang/String) | [EXTRA_NDEF_MESSAGES](https://developer.android.com/reference/android/nfc/NfcAdapter#EXTRA_NDEF_MESSAGES) Extra containing an array of[NdefMessage](https://developer.android.com/reference/android/nfc/NdefMessage)present on the discovered tag.                                                                                                                                                                                                                                                                                                                     |
| [String](https://developer.android.com/reference/java/lang/String) | [EXTRA_PREFERRED_PAYMENT_CHANGED_REASON](https://developer.android.com/reference/android/nfc/NfcAdapter#EXTRA_PREFERRED_PAYMENT_CHANGED_REASON) Mandatory String extra field in[ACTION_PREFERRED_PAYMENT_CHANGED](https://developer.android.com/reference/android/nfc/NfcAdapter#ACTION_PREFERRED_PAYMENT_CHANGED)Indicates the condition when trigger this event.                                                                                                                                                                                                     |
| [String](https://developer.android.com/reference/java/lang/String) | [EXTRA_READER_PRESENCE_CHECK_DELAY](https://developer.android.com/reference/android/nfc/NfcAdapter#EXTRA_READER_PRESENCE_CHECK_DELAY) Int Extra for use with[enableReaderMode(android.app.Activity, android.nfc.NfcAdapter.ReaderCallback, int, android.os.Bundle)](https://developer.android.com/reference/android/nfc/NfcAdapter#enableReaderMode(android.app.Activity,%20android.nfc.NfcAdapter.ReaderCallback,%20int,%20android.os.Bundle)).                                                                                                                       |
| [String](https://developer.android.com/reference/java/lang/String) | [EXTRA_SECURE_ELEMENT_NAME](https://developer.android.com/reference/android/nfc/NfcAdapter#EXTRA_SECURE_ELEMENT_NAME) Mandatory String extra field in[ACTION_TRANSACTION_DETECTED](https://developer.android.com/reference/android/nfc/NfcAdapter#ACTION_TRANSACTION_DETECTED)Indicates the Secure Element on which the transaction occurred.                                                                                                                                                                                                                          |
| [String](https://developer.android.com/reference/java/lang/String) | [EXTRA_TAG](https://developer.android.com/reference/android/nfc/NfcAdapter#EXTRA_TAG) Mandatory extra containing the[Tag](https://developer.android.com/reference/android/nfc/Tag)that was discovered for the[ACTION_NDEF_DISCOVERED](https://developer.android.com/reference/android/nfc/NfcAdapter#ACTION_NDEF_DISCOVERED),[ACTION_TECH_DISCOVERED](https://developer.android.com/reference/android/nfc/NfcAdapter#ACTION_TECH_DISCOVERED), and[ACTION_TAG_DISCOVERED](https://developer.android.com/reference/android/nfc/NfcAdapter#ACTION_TAG_DISCOVERED)intents. |
| `int`                                                              | [FLAG_LISTEN_DISABLE](https://developer.android.com/reference/android/nfc/NfcAdapter#FLAG_LISTEN_DISABLE) Flags for use with[setDiscoveryTechnology(android.app.Activity, int, int)](https://developer.android.com/reference/android/nfc/NfcAdapter#setDiscoveryTechnology(android.app.Activity,%20int,%20int)).                                                                                                                                                                                                                                                       |
| `int`                                                              | [FLAG_LISTEN_KEEP](https://developer.android.com/reference/android/nfc/NfcAdapter#FLAG_LISTEN_KEEP) Flags for use with[setDiscoveryTechnology(android.app.Activity, int, int)](https://developer.android.com/reference/android/nfc/NfcAdapter#setDiscoveryTechnology(android.app.Activity,%20int,%20int)).                                                                                                                                                                                                                                                             |
| `int`                                                              | [FLAG_LISTEN_NFC_PASSIVE_A](https://developer.android.com/reference/android/nfc/NfcAdapter#FLAG_LISTEN_NFC_PASSIVE_A) Flag for use with[setDiscoveryTechnology(android.app.Activity, int, int)](https://developer.android.com/reference/android/nfc/NfcAdapter#setDiscoveryTechnology(android.app.Activity,%20int,%20int)).                                                                                                                                                                                                                                            |
| `int`                                                              | [FLAG_LISTEN_NFC_PASSIVE_B](https://developer.android.com/reference/android/nfc/NfcAdapter#FLAG_LISTEN_NFC_PASSIVE_B) Flag for use with[setDiscoveryTechnology(android.app.Activity, int, int)](https://developer.android.com/reference/android/nfc/NfcAdapter#setDiscoveryTechnology(android.app.Activity,%20int,%20int)).                                                                                                                                                                                                                                            |
| `int`                                                              | [FLAG_LISTEN_NFC_PASSIVE_F](https://developer.android.com/reference/android/nfc/NfcAdapter#FLAG_LISTEN_NFC_PASSIVE_F) Flag for use with[setDiscoveryTechnology(android.app.Activity, int, int)](https://developer.android.com/reference/android/nfc/NfcAdapter#setDiscoveryTechnology(android.app.Activity,%20int,%20int)).                                                                                                                                                                                                                                            |
| `int`                                                              | [FLAG_READER_DISABLE](https://developer.android.com/reference/android/nfc/NfcAdapter#FLAG_READER_DISABLE) Flags for use with[setDiscoveryTechnology(android.app.Activity, int, int)](https://developer.android.com/reference/android/nfc/NfcAdapter#setDiscoveryTechnology(android.app.Activity,%20int,%20int)).                                                                                                                                                                                                                                                       |
| `int`                                                              | [FLAG_READER_KEEP](https://developer.android.com/reference/android/nfc/NfcAdapter#FLAG_READER_KEEP) Flags for use with[setDiscoveryTechnology(android.app.Activity, int, int)](https://developer.android.com/reference/android/nfc/NfcAdapter#setDiscoveryTechnology(android.app.Activity,%20int,%20int)).                                                                                                                                                                                                                                                             |
| `int`                                                              | [FLAG_READER_NFC_A](https://developer.android.com/reference/android/nfc/NfcAdapter#FLAG_READER_NFC_A) Flag for use with[enableReaderMode(android.app.Activity, android.nfc.NfcAdapter.ReaderCallback, int, android.os.Bundle)](https://developer.android.com/reference/android/nfc/NfcAdapter#enableReaderMode(android.app.Activity,%20android.nfc.NfcAdapter.ReaderCallback,%20int,%20android.os.Bundle)).                                                                                                                                                            |
| `int`                                                              | [FLAG_READER_NFC_B](https://developer.android.com/reference/android/nfc/NfcAdapter#FLAG_READER_NFC_B) Flag for use with[enableReaderMode(android.app.Activity, android.nfc.NfcAdapter.ReaderCallback, int, android.os.Bundle)](https://developer.android.com/reference/android/nfc/NfcAdapter#enableReaderMode(android.app.Activity,%20android.nfc.NfcAdapter.ReaderCallback,%20int,%20android.os.Bundle)).                                                                                                                                                            |
| `int`                                                              | [FLAG_READER_NFC_BARCODE](https://developer.android.com/reference/android/nfc/NfcAdapter#FLAG_READER_NFC_BARCODE) Flag for use with[enableReaderMode(android.app.Activity, android.nfc.NfcAdapter.ReaderCallback, int, android.os.Bundle)](https://developer.android.com/reference/android/nfc/NfcAdapter#enableReaderMode(android.app.Activity,%20android.nfc.NfcAdapter.ReaderCallback,%20int,%20android.os.Bundle)).                                                                                                                                                |
| `int`                                                              | [FLAG_READER_NFC_F](https://developer.android.com/reference/android/nfc/NfcAdapter#FLAG_READER_NFC_F) Flag for use with[enableReaderMode(android.app.Activity, android.nfc.NfcAdapter.ReaderCallback, int, android.os.Bundle)](https://developer.android.com/reference/android/nfc/NfcAdapter#enableReaderMode(android.app.Activity,%20android.nfc.NfcAdapter.ReaderCallback,%20int,%20android.os.Bundle)).                                                                                                                                                            |
| `int`                                                              | [FLAG_READER_NFC_V](https://developer.android.com/reference/android/nfc/NfcAdapter#FLAG_READER_NFC_V) Flag for use with[enableReaderMode(android.app.Activity, android.nfc.NfcAdapter.ReaderCallback, int, android.os.Bundle)](https://developer.android.com/reference/android/nfc/NfcAdapter#enableReaderMode(android.app.Activity,%20android.nfc.NfcAdapter.ReaderCallback,%20int,%20android.os.Bundle)).                                                                                                                                                            |
| `int`                                                              | [FLAG_READER_NO_PLATFORM_SOUNDS](https://developer.android.com/reference/android/nfc/NfcAdapter#FLAG_READER_NO_PLATFORM_SOUNDS) Flag for use with[enableReaderMode(android.app.Activity, android.nfc.NfcAdapter.ReaderCallback, int, android.os.Bundle)](https://developer.android.com/reference/android/nfc/NfcAdapter#enableReaderMode(android.app.Activity,%20android.nfc.NfcAdapter.ReaderCallback,%20int,%20android.os.Bundle)).                                                                                                                                  |
| `int`                                                              | [FLAG_READER_SKIP_NDEF_CHECK](https://developer.android.com/reference/android/nfc/NfcAdapter#FLAG_READER_SKIP_NDEF_CHECK) Flag for use with[enableReaderMode(android.app.Activity, android.nfc.NfcAdapter.ReaderCallback, int, android.os.Bundle)](https://developer.android.com/reference/android/nfc/NfcAdapter#enableReaderMode(android.app.Activity,%20android.nfc.NfcAdapter.ReaderCallback,%20int,%20android.os.Bundle)).                                                                                                                                        |
| `int`                                                              | [PREFERRED_PAYMENT_CHANGED](https://developer.android.com/reference/android/nfc/NfcAdapter#PREFERRED_PAYMENT_CHANGED) User selected another payment application as the preferred payment.                                                                                                                                                                                                                                                                                                                                                                              |
| `int`                                                              | [PREFERRED_PAYMENT_LOADED](https://developer.android.com/reference/android/nfc/NfcAdapter#PREFERRED_PAYMENT_LOADED) Nfc is enabled and the preferred payment aids are registered.                                                                                                                                                                                                                                                                                                                                                                                      |
| `int`                                                              | [PREFERRED_PAYMENT_UPDATED](https://developer.android.com/reference/android/nfc/NfcAdapter#PREFERRED_PAYMENT_UPDATED) Current preferred payment has issued an update (registered/unregistered new aids or has been updated itself).                                                                                                                                                                                                                                                                                                                                    |
| `int`                                                              | [STATE_OFF](https://developer.android.com/reference/android/nfc/NfcAdapter#STATE_OFF) <br />                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| `int`                                                              | [STATE_ON](https://developer.android.com/reference/android/nfc/NfcAdapter#STATE_ON) <br />                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| `int`                                                              | [STATE_TURNING_OFF](https://developer.android.com/reference/android/nfc/NfcAdapter#STATE_TURNING_OFF) <br />                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| `int`                                                              | [STATE_TURNING_ON](https://developer.android.com/reference/android/nfc/NfcAdapter#STATE_TURNING_ON) <br />                                                                                                                                                                                                                                                                                                                                                                                                                                                             |

|                                                                                                                                                                                                                                                                                                                                                                    ### Public methods                                                                                                                                                                                                                                                                                                                                                                     ||
|-----------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ` boolean`                                                                              | ` `[disable](https://developer.android.com/reference/android/nfc/NfcAdapter#disable())`() ` Disable NFC hardware.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| ` void`                                                                                 | ` `[disableForegroundDispatch](https://developer.android.com/reference/android/nfc/NfcAdapter#disableForegroundDispatch(android.app.Activity))`(`[Activity](https://developer.android.com/reference/android/app/Activity)` activity) ` Disable foreground dispatch to the given activity.                                                                                                                                                                                                                                                                                                                                                                        |
| ` void`                                                                                 | ` `[disableReaderMode](https://developer.android.com/reference/android/nfc/NfcAdapter#disableReaderMode(android.app.Activity))`(`[Activity](https://developer.android.com/reference/android/app/Activity)` activity) ` Restore the NFC adapter to normal mode of operation: supporting peer-to-peer (Android Beam), card emulation, and polling for all supported tag technologies.                                                                                                                                                                                                                                                                              |
| ` boolean`                                                                              | ` `[enable](https://developer.android.com/reference/android/nfc/NfcAdapter#enable())`() ` Enable NFC hardware.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| ` void`                                                                                 | ` `[enableForegroundDispatch](https://developer.android.com/reference/android/nfc/NfcAdapter#enableForegroundDispatch(android.app.Activity,%20android.app.PendingIntent,%20android.content.IntentFilter[],%20java.lang.String[][]))`(`[Activity](https://developer.android.com/reference/android/app/Activity)` activity, `[PendingIntent](https://developer.android.com/reference/android/app/PendingIntent)` intent, `[IntentFilter[]](https://developer.android.com/reference/android/content/IntentFilter)` filters, `[String[][]](https://developer.android.com/reference/java/lang/String)` techLists) ` Enable foreground dispatch to the given Activity. |
| ` void`                                                                                 | ` `[enableReaderMode](https://developer.android.com/reference/android/nfc/NfcAdapter#enableReaderMode(android.app.Activity,%20android.nfc.NfcAdapter.ReaderCallback,%20int,%20android.os.Bundle))`(`[Activity](https://developer.android.com/reference/android/app/Activity)` activity, `[NfcAdapter.ReaderCallback](https://developer.android.com/reference/android/nfc/NfcAdapter.ReaderCallback)` callback, int flags, `[Bundle](https://developer.android.com/reference/android/os/Bundle)` extras) ` Limit the NFC controller to reader mode while this Activity is in the foreground.                                                                      |
| ` static `[NfcAdapter](https://developer.android.com/reference/android/nfc/NfcAdapter)  | ` `[getDefaultAdapter](https://developer.android.com/reference/android/nfc/NfcAdapter#getDefaultAdapter(android.content.Context))`(`[Context](https://developer.android.com/reference/android/content/Context)` context) ` Helper to get the default NFC Adapter.                                                                                                                                                                                                                                                                                                                                                                                                |
| ` `[NfcAntennaInfo](https://developer.android.com/reference/android/nfc/NfcAntennaInfo) | ` `[getNfcAntennaInfo](https://developer.android.com/reference/android/nfc/NfcAdapter#getNfcAntennaInfo())`() ` Returns information regarding Nfc antennas on the device such as their relative positioning on the device.                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| ` boolean`                                                                              | ` `[ignore](https://developer.android.com/reference/android/nfc/NfcAdapter#ignore(android.nfc.Tag,%20int,%20android.nfc.NfcAdapter.OnTagRemovedListener,%20android.os.Handler))`(`[Tag](https://developer.android.com/reference/android/nfc/Tag)` tag, int debounceMs, `[NfcAdapter.OnTagRemovedListener](https://developer.android.com/reference/android/nfc/NfcAdapter.OnTagRemovedListener)` tagRemovedListener, `[Handler](https://developer.android.com/reference/android/os/Handler)` handler) ` Signals that you are no longer interested in communicating with an NFC tag for as long as it remains in range.                                            |
| ` boolean`                                                                              | ` `[isEnabled](https://developer.android.com/reference/android/nfc/NfcAdapter#isEnabled())`() ` Return true if this NFC Adapter has any features enabled.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| ` boolean`                                                                              | ` `[isExitFramesSupported](https://developer.android.com/reference/android/nfc/NfcAdapter#isExitFramesSupported())`() ` Returns whether the device supports exit frames or not.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| ` boolean`                                                                              | ` `[isObserveModeEnabled](https://developer.android.com/reference/android/nfc/NfcAdapter#isObserveModeEnabled())`() ` Returns whether Observe Mode is currently enabled or not.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| ` boolean`                                                                              | ` `[isObserveModeSupported](https://developer.android.com/reference/android/nfc/NfcAdapter#isObserveModeSupported())`() ` Returns whether the device supports observe mode or not.                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| ` boolean`                                                                              | ` `[isPowerSavingModeEnabled](https://developer.android.com/reference/android/nfc/NfcAdapter#isPowerSavingModeEnabled())`() ` Returns whether power-saving mode is currently enabled or not.                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| ` boolean`                                                                              | ` `[isPowerSavingModeSupported](https://developer.android.com/reference/android/nfc/NfcAdapter#isPowerSavingModeSupported())`() ` Returns whether the device supports power-saving mode or not.                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| ` boolean`                                                                              | ` `[isReaderOptionEnabled](https://developer.android.com/reference/android/nfc/NfcAdapter#isReaderOptionEnabled())`() ` Checks NFC Reader option feature is enabled.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| ` boolean`                                                                              | ` `[isReaderOptionSupported](https://developer.android.com/reference/android/nfc/NfcAdapter#isReaderOptionSupported())`() ` Checks if the device supports NFC Reader option functionality.                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| ` boolean`                                                                              | ` `[isSecureNfcEnabled](https://developer.android.com/reference/android/nfc/NfcAdapter#isSecureNfcEnabled())`() ` Checks Secure NFC feature is enabled.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| ` boolean`                                                                              | ` `[isSecureNfcSupported](https://developer.android.com/reference/android/nfc/NfcAdapter#isSecureNfcSupported())`() ` Checks if the device supports Secure NFC functionality.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| ` boolean`                                                                              | ` `[isTagIntentAllowed](https://developer.android.com/reference/android/nfc/NfcAdapter#isTagIntentAllowed())`() ` Checks whether the user has disabled the calling app from receiving NFC tag intents.                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| ` boolean`                                                                              | ` `[isTagIntentAppPreferenceSupported](https://developer.android.com/reference/android/nfc/NfcAdapter#isTagIntentAppPreferenceSupported())`() ` Checks if the device supports Tag Intent App Preference functionality.                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| ` void`                                                                                 | ` `[resetDiscoveryTechnology](https://developer.android.com/reference/android/nfc/NfcAdapter#resetDiscoveryTechnology(android.app.Activity))`(`[Activity](https://developer.android.com/reference/android/app/Activity)` activity) ` Restore the poll/listen technologies of NFC controller to its default state, which were changed by[setDiscoveryTechnology(android.app.Activity, int, int)](https://developer.android.com/reference/android/nfc/NfcAdapter#setDiscoveryTechnology(android.app.Activity,%20int,%20int))                                                                                                                                       |
| ` void`                                                                                 | ` `[setDiscoveryTechnology](https://developer.android.com/reference/android/nfc/NfcAdapter#setDiscoveryTechnology(android.app.Activity,%20int,%20int))`(`[Activity](https://developer.android.com/reference/android/app/Activity)` activity, int pollTechnology, int listenTechnology) ` Set the NFC controller to enable specific poll/listen technologies, as specified in parameters, while this Activity is in the foreground.                                                                                                                                                                                                                               |
| ` boolean`                                                                              | ` `[setObserveModeEnabled](https://developer.android.com/reference/android/nfc/NfcAdapter#setObserveModeEnabled(boolean))`(boolean enabled) ` Controls whether the NFC adapter will allow transactions to proceed or be in observe mode and simply observe and notify the APDU service of polling loop frames.                                                                                                                                                                                                                                                                                                                                                   |
| ` void`                                                                                 | ` `[setPowerSavingMode](https://developer.android.com/reference/android/nfc/NfcAdapter#setPowerSavingMode(boolean))`(boolean enabled) ` Sets whether or not the NFC chip should be in power-saving mode next time it is disabled with[NfcAdapter.disable()](https://developer.android.com/reference/android/nfc/NfcAdapter#disable()).                                                                                                                                                                                                                                                                                                                           |

| ### Inherited methods |
|-----------------------|---|
| From class` `[java.lang.Object](https://developer.android.com/reference/java/lang/Object)` ` |--------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | ` `[Object](https://developer.android.com/reference/java/lang/Object)          | ` `[clone](https://developer.android.com/reference/java/lang/Object#clone())`() ` Creates and returns a copy of this object.                                                                                                                                                      | | ` boolean`                                                                     | ` `[equals](https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object))`(`[Object](https://developer.android.com/reference/java/lang/Object)` obj) ` Indicates whether some other object is "equal to" this one.                                           | | ` void`                                                                        | ` `[finalize](https://developer.android.com/reference/java/lang/Object#finalize())`() ` Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.                                                          | | ` final `[Class](https://developer.android.com/reference/java/lang/Class)`<?>` | ` `[getClass](https://developer.android.com/reference/java/lang/Object#getClass())`() ` Returns the runtime class of this`Object`.                                                                                                                                                | | ` int`                                                                         | ` `[hashCode](https://developer.android.com/reference/java/lang/Object#hashCode())`() ` Returns a hash code value for the object.                                                                                                                                                 | | ` final void`                                                                  | ` `[notify](https://developer.android.com/reference/java/lang/Object#notify())`() ` Wakes up a single thread that is waiting on this object's monitor.                                                                                                                            | | ` final void`                                                                  | ` `[notifyAll](https://developer.android.com/reference/java/lang/Object#notifyAll())`() ` Wakes up all threads that are waiting on this object's monitor.                                                                                                                         | | ` `[String](https://developer.android.com/reference/java/lang/String)          | ` `[toString](https://developer.android.com/reference/java/lang/Object#toString())`() ` Returns a string representation of the object.                                                                                                                                            | | ` final void`                                                                  | ` `[wait](https://developer.android.com/reference/java/lang/Object#wait(long,%20int))`(long timeoutMillis, int nanos) ` Causes the current thread to wait until it is awakened, typically by being*notified* or*interrupted*, or until a certain amount of real time has elapsed. | | ` final void`                                                                  | ` `[wait](https://developer.android.com/reference/java/lang/Object#wait(long))`(long timeoutMillis) ` Causes the current thread to wait until it is awakened, typically by being*notified* or*interrupted*, or until a certain amount of real time has elapsed.                   | | ` final void`                                                                  | ` `[wait](https://developer.android.com/reference/java/lang/Object#wait())`() ` Causes the current thread to wait until it is awakened, typically by being*notified* or*interrupted*.                                                                                             | ||

## Constants

### ACTION_ADAPTER_STATE_CHANGED

Added in[API level 18](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final String ACTION_ADAPTER_STATE_CHANGED
```

Broadcast Action: The state of the local NFC adapter has been changed.

For example, NFC has been turned on or off.

Always contains the extra field[EXTRA_ADAPTER_STATE](https://developer.android.com/reference/android/nfc/NfcAdapter#EXTRA_ADAPTER_STATE)

<br />

Constant Value: "android.nfc.action.ADAPTER_STATE_CHANGED"  

### ACTION_CHANGE_TAG_INTENT_PREFERENCE

Added in[API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final String ACTION_CHANGE_TAG_INTENT_PREFERENCE
```

Activity action: Bring up the settings page that allows the user to enable or disable tag intent reception for apps.

This will direct user to the settings page shows a list that asks users whether they want to allow or disallow the package to start an activity when a tag is discovered.

<br />

Constant Value: "android.nfc.action.CHANGE_TAG_INTENT_PREFERENCE"  

### ACTION_NDEF_DISCOVERED

Added in[API level 10](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final String ACTION_NDEF_DISCOVERED
```

Intent to start an activity when a tag with NDEF payload is discovered.

The system inspects the first[NdefRecord](https://developer.android.com/reference/android/nfc/NdefRecord)in the first[NdefMessage](https://developer.android.com/reference/android/nfc/NdefMessage)and looks for a URI, SmartPoster, or MIME record. If a URI or SmartPoster record is found the intent will contain the URI in its data field. If a MIME record is found the intent will contain the MIME type in its type field. This allows activities to register[IntentFilter](https://developer.android.com/reference/android/content/IntentFilter)s targeting specific content on tags. Activities should register the most specific intent filters possible to avoid the activity chooser dialog, which can disrupt the interaction with the tag as the user interacts with the screen.

If the tag has an NDEF payload this intent is started before[ACTION_TECH_DISCOVERED](https://developer.android.com/reference/android/nfc/NfcAdapter#ACTION_TECH_DISCOVERED). If any activities respond to this intent neither[ACTION_TECH_DISCOVERED](https://developer.android.com/reference/android/nfc/NfcAdapter#ACTION_TECH_DISCOVERED)or[ACTION_TAG_DISCOVERED](https://developer.android.com/reference/android/nfc/NfcAdapter#ACTION_TAG_DISCOVERED)will be started.

The MIME type or data URI of this intent are normalized before dispatch - so that MIME, URI scheme and URI host are always lower-case.

<br />

Constant Value: "android.nfc.action.NDEF_DISCOVERED"  

### ACTION_PREFERRED_PAYMENT_CHANGED

Added in[API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final String ACTION_PREFERRED_PAYMENT_CHANGED
```

Broadcast Action: Intent to notify if the preferred payment service changed.

This intent will only be sent to the application has requested permission for[Manifest.permission.NFC_PREFERRED_PAYMENT_INFO](https://developer.android.com/reference/android/Manifest.permission#NFC_PREFERRED_PAYMENT_INFO)and if the application has the necessary access to Secure Element which witnessed the particular event.  
Requires[Manifest.permission.NFC_PREFERRED_PAYMENT_INFO](https://developer.android.com/reference/android/Manifest.permission#NFC_PREFERRED_PAYMENT_INFO)

<br />

Constant Value: "android.nfc.action.PREFERRED_PAYMENT_CHANGED"  

### ACTION_TAG_DISCOVERED

Added in[API level 9](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final String ACTION_TAG_DISCOVERED
```

Intent to start an activity when a tag is discovered.

This intent will not be started when a tag is discovered if any activities respond to[ACTION_NDEF_DISCOVERED](https://developer.android.com/reference/android/nfc/NfcAdapter#ACTION_NDEF_DISCOVERED)or[ACTION_TECH_DISCOVERED](https://developer.android.com/reference/android/nfc/NfcAdapter#ACTION_TECH_DISCOVERED)for the current tag.

<br />

Constant Value: "android.nfc.action.TAG_DISCOVERED"  

### ACTION_TECH_DISCOVERED

Added in[API level 10](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final String ACTION_TECH_DISCOVERED
```

Intent to start an activity when a tag is discovered and activities are registered for the specific technologies on the tag.

To receive this intent an activity must include an intent filter for this action and specify the desired tech types in a manifest`meta-data`entry. Here is an example manfiest entry:  

```
 <activity android:name=".nfc.TechFilter" android:label="NFC/TechFilter">
     <!-- Add a technology filter -->
     <intent-filter>
         <action android:name="android.nfc.action.TECH_DISCOVERED" />
     </intent-filter>

     <meta-data android:name="android.nfc.action.TECH_DISCOVERED"
         android:resource="@xml/filter_nfc"
     />
 </activity>
```

The meta-data XML file should contain one or more`tech-list`entries each consisting or one or more`tech`entries. The`tech`entries refer to the qualified class name implementing the technology, for example "android.nfc.tech.NfcA".

A tag matches if any of the`tech-list`sets is a subset of[Tag.getTechList()](https://developer.android.com/reference/android/nfc/Tag#getTechList()). Each of the`tech-list`s is considered independently and the activity is considered a match is any single`tech-list`matches the tag that was discovered. This provides AND and OR semantics for filtering desired techs. Here is an example that will match any tag using[NfcF](https://developer.android.com/reference/android/nfc/tech/NfcF)or any tag using[NfcA](https://developer.android.com/reference/android/nfc/tech/NfcA),[MifareClassic](https://developer.android.com/reference/android/nfc/tech/MifareClassic), and[Ndef](https://developer.android.com/reference/android/nfc/tech/Ndef):  

```
 <resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
     <!-- capture anything using NfcF -->
     <tech-list>
         <tech>android.nfc.tech.NfcF</tech>
     </tech-list>

     <!-- OR -->

     <!-- capture all MIFARE Classics with NDEF payloads -->
     <tech-list>
         <tech>android.nfc.tech.NfcA</tech>
         <tech>android.nfc.tech.MifareClassic</tech>
         <tech>android.nfc.tech.Ndef</tech>
     </tech-list>
 </resources>
```

This intent is started after[ACTION_NDEF_DISCOVERED](https://developer.android.com/reference/android/nfc/NfcAdapter#ACTION_NDEF_DISCOVERED)and before[ACTION_TAG_DISCOVERED](https://developer.android.com/reference/android/nfc/NfcAdapter#ACTION_TAG_DISCOVERED). If any activities respond to[ACTION_NDEF_DISCOVERED](https://developer.android.com/reference/android/nfc/NfcAdapter#ACTION_NDEF_DISCOVERED)this intent will not be started. If any activities respond to this intent[ACTION_TAG_DISCOVERED](https://developer.android.com/reference/android/nfc/NfcAdapter#ACTION_TAG_DISCOVERED)will not be started.

<br />

Constant Value: "android.nfc.action.TECH_DISCOVERED"  

### ACTION_TRANSACTION_DETECTED

Added in[API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final String ACTION_TRANSACTION_DETECTED
```

Broadcast Action: Intent to notify an application that a transaction event has occurred on the Secure Element.

This intent will only be sent if the application has requested permission for[Manifest.permission.NFC_TRANSACTION_EVENT](https://developer.android.com/reference/android/Manifest.permission#NFC_TRANSACTION_EVENT)and if the application has the necessary access to Secure Element which witnessed the particular event.  
Requires[Manifest.permission.NFC_TRANSACTION_EVENT](https://developer.android.com/reference/android/Manifest.permission#NFC_TRANSACTION_EVENT)

<br />

Constant Value: "android.nfc.action.TRANSACTION_DETECTED"  

### EXTRA_ADAPTER_STATE

Added in[API level 18](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final String EXTRA_ADAPTER_STATE
```

Used as an int extra field in[ACTION_ADAPTER_STATE_CHANGED](https://developer.android.com/reference/android/nfc/NfcAdapter#ACTION_ADAPTER_STATE_CHANGED)intents to request the current power state. Possible values are:[STATE_OFF](https://developer.android.com/reference/android/nfc/NfcAdapter#STATE_OFF),[STATE_TURNING_ON](https://developer.android.com/reference/android/nfc/NfcAdapter#STATE_TURNING_ON),[STATE_ON](https://developer.android.com/reference/android/nfc/NfcAdapter#STATE_ON),[STATE_TURNING_OFF](https://developer.android.com/reference/android/nfc/NfcAdapter#STATE_TURNING_OFF),

<br />

Constant Value: "android.nfc.extra.ADAPTER_STATE"  

### EXTRA_AID

Added in[API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final String EXTRA_AID
```

Mandatory byte\[\] extra field in[ACTION_TRANSACTION_DETECTED](https://developer.android.com/reference/android/nfc/NfcAdapter#ACTION_TRANSACTION_DETECTED)

<br />

Constant Value: "android.nfc.extra.AID"  

### EXTRA_DATA

Added in[API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final String EXTRA_DATA
```

Optional byte\[\] extra field in[ACTION_TRANSACTION_DETECTED](https://developer.android.com/reference/android/nfc/NfcAdapter#ACTION_TRANSACTION_DETECTED)

<br />

Constant Value: "android.nfc.extra.DATA"  

### EXTRA_ID

Added in[API level 9](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final String EXTRA_ID
```

Optional extra containing a byte array containing the ID of the discovered tag for the[ACTION_NDEF_DISCOVERED](https://developer.android.com/reference/android/nfc/NfcAdapter#ACTION_NDEF_DISCOVERED),[ACTION_TECH_DISCOVERED](https://developer.android.com/reference/android/nfc/NfcAdapter#ACTION_TECH_DISCOVERED), and[ACTION_TAG_DISCOVERED](https://developer.android.com/reference/android/nfc/NfcAdapter#ACTION_TAG_DISCOVERED)intents.

<br />

Constant Value: "android.nfc.extra.ID"  

### EXTRA_NDEF_MESSAGES

Added in[API level 9](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final String EXTRA_NDEF_MESSAGES
```

Extra containing an array of[NdefMessage](https://developer.android.com/reference/android/nfc/NdefMessage)present on the discovered tag.

This extra is mandatory for[ACTION_NDEF_DISCOVERED](https://developer.android.com/reference/android/nfc/NfcAdapter#ACTION_NDEF_DISCOVERED)intents, and optional for[ACTION_TECH_DISCOVERED](https://developer.android.com/reference/android/nfc/NfcAdapter#ACTION_TECH_DISCOVERED), and[ACTION_TAG_DISCOVERED](https://developer.android.com/reference/android/nfc/NfcAdapter#ACTION_TAG_DISCOVERED)intents.

When this extra is present there will always be at least one[NdefMessage](https://developer.android.com/reference/android/nfc/NdefMessage)element. Most NDEF tags have only one NDEF message, but we use an array for future compatibility.

<br />

Constant Value: "android.nfc.extra.NDEF_MESSAGES"  

### EXTRA_PREFERRED_PAYMENT_CHANGED_REASON

Added in[API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final String EXTRA_PREFERRED_PAYMENT_CHANGED_REASON
```

Mandatory String extra field in[ACTION_PREFERRED_PAYMENT_CHANGED](https://developer.android.com/reference/android/nfc/NfcAdapter#ACTION_PREFERRED_PAYMENT_CHANGED)Indicates the condition when trigger this event. Possible values are:[PREFERRED_PAYMENT_LOADED](https://developer.android.com/reference/android/nfc/NfcAdapter#PREFERRED_PAYMENT_LOADED),[PREFERRED_PAYMENT_CHANGED](https://developer.android.com/reference/android/nfc/NfcAdapter#PREFERRED_PAYMENT_CHANGED),[PREFERRED_PAYMENT_UPDATED](https://developer.android.com/reference/android/nfc/NfcAdapter#PREFERRED_PAYMENT_UPDATED),

<br />

Constant Value: "android.nfc.extra.PREFERRED_PAYMENT_CHANGED_REASON"  

### EXTRA_READER_PRESENCE_CHECK_DELAY

Added in[API level 19](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final String EXTRA_READER_PRESENCE_CHECK_DELAY
```

Int Extra for use with[enableReaderMode(android.app.Activity, android.nfc.NfcAdapter.ReaderCallback, int, android.os.Bundle)](https://developer.android.com/reference/android/nfc/NfcAdapter#enableReaderMode(android.app.Activity,%20android.nfc.NfcAdapter.ReaderCallback,%20int,%20android.os.Bundle)).

Setting this integer extra allows the calling application to specify the delay that the platform will use for performing presence checks on any discovered tag.

<br />

Constant Value: "presence"  

### EXTRA_SECURE_ELEMENT_NAME

Added in[API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final String EXTRA_SECURE_ELEMENT_NAME
```

Mandatory String extra field in[ACTION_TRANSACTION_DETECTED](https://developer.android.com/reference/android/nfc/NfcAdapter#ACTION_TRANSACTION_DETECTED)Indicates the Secure Element on which the transaction occurred. eSE1...eSEn for Embedded Secure Elements, SIM1...SIMn for UICC/EUICC, etc.

<br />

Constant Value: "android.nfc.extra.SECURE_ELEMENT_NAME"  

### EXTRA_TAG

Added in[API level 10](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final String EXTRA_TAG
```

Mandatory extra containing the[Tag](https://developer.android.com/reference/android/nfc/Tag)that was discovered for the[ACTION_NDEF_DISCOVERED](https://developer.android.com/reference/android/nfc/NfcAdapter#ACTION_NDEF_DISCOVERED),[ACTION_TECH_DISCOVERED](https://developer.android.com/reference/android/nfc/NfcAdapter#ACTION_TECH_DISCOVERED), and[ACTION_TAG_DISCOVERED](https://developer.android.com/reference/android/nfc/NfcAdapter#ACTION_TAG_DISCOVERED)intents.

<br />

Constant Value: "android.nfc.extra.TAG"  

### FLAG_LISTEN_DISABLE

Added in[API level 35](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final int FLAG_LISTEN_DISABLE
```

Flags for use with[setDiscoveryTechnology(android.app.Activity, int, int)](https://developer.android.com/reference/android/nfc/NfcAdapter#setDiscoveryTechnology(android.app.Activity,%20int,%20int)).

Setting this flag disables listening.

<br />

Constant Value: 0 (0x00000000)  

### FLAG_LISTEN_KEEP

Added in[API level 35](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final int FLAG_LISTEN_KEEP
```

Flags for use with[setDiscoveryTechnology(android.app.Activity, int, int)](https://developer.android.com/reference/android/nfc/NfcAdapter#setDiscoveryTechnology(android.app.Activity,%20int,%20int)).

Setting this flag makes listening to be set to the current stored default technology configuration.

<br />

Constant Value: -2147483648 (0x80000000)  

### FLAG_LISTEN_NFC_PASSIVE_A

Added in[API level 35](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final int FLAG_LISTEN_NFC_PASSIVE_A
```

Flag for use with[setDiscoveryTechnology(android.app.Activity, int, int)](https://developer.android.com/reference/android/nfc/NfcAdapter#setDiscoveryTechnology(android.app.Activity,%20int,%20int)).

Setting this flag enables listening for Nfc-A technology.

<br />

Constant Value: 1 (0x00000001)  

### FLAG_LISTEN_NFC_PASSIVE_B

Added in[API level 35](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final int FLAG_LISTEN_NFC_PASSIVE_B
```

Flag for use with[setDiscoveryTechnology(android.app.Activity, int, int)](https://developer.android.com/reference/android/nfc/NfcAdapter#setDiscoveryTechnology(android.app.Activity,%20int,%20int)).

Setting this flag enables listening for Nfc-B technology.

<br />

Constant Value: 2 (0x00000002)  

### FLAG_LISTEN_NFC_PASSIVE_F

Added in[API level 35](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final int FLAG_LISTEN_NFC_PASSIVE_F
```

Flag for use with[setDiscoveryTechnology(android.app.Activity, int, int)](https://developer.android.com/reference/android/nfc/NfcAdapter#setDiscoveryTechnology(android.app.Activity,%20int,%20int)).

Setting this flag enables listening for Nfc-F technology.

<br />

Constant Value: 4 (0x00000004)  

### FLAG_READER_DISABLE

Added in[API level 35](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final int FLAG_READER_DISABLE
```

Flags for use with[setDiscoveryTechnology(android.app.Activity, int, int)](https://developer.android.com/reference/android/nfc/NfcAdapter#setDiscoveryTechnology(android.app.Activity,%20int,%20int)).

Setting this flag disables polling.

<br />

Constant Value: 0 (0x00000000)  

### FLAG_READER_KEEP

Added in[API level 35](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final int FLAG_READER_KEEP
```

Flags for use with[setDiscoveryTechnology(android.app.Activity, int, int)](https://developer.android.com/reference/android/nfc/NfcAdapter#setDiscoveryTechnology(android.app.Activity,%20int,%20int)).

Setting this flag makes polling to be set to the current stored default technology configuration.

<br />

Constant Value: -2147483648 (0x80000000)  

### FLAG_READER_NFC_A

Added in[API level 19](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final int FLAG_READER_NFC_A
```

Flag for use with[enableReaderMode(android.app.Activity, android.nfc.NfcAdapter.ReaderCallback, int, android.os.Bundle)](https://developer.android.com/reference/android/nfc/NfcAdapter#enableReaderMode(android.app.Activity,%20android.nfc.NfcAdapter.ReaderCallback,%20int,%20android.os.Bundle)).

Setting this flag enables polling for Nfc-A technology.

<br />

Constant Value: 1 (0x00000001)  

### FLAG_READER_NFC_B

Added in[API level 19](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final int FLAG_READER_NFC_B
```

Flag for use with[enableReaderMode(android.app.Activity, android.nfc.NfcAdapter.ReaderCallback, int, android.os.Bundle)](https://developer.android.com/reference/android/nfc/NfcAdapter#enableReaderMode(android.app.Activity,%20android.nfc.NfcAdapter.ReaderCallback,%20int,%20android.os.Bundle)).

Setting this flag enables polling for Nfc-B technology.

<br />

Constant Value: 2 (0x00000002)  

### FLAG_READER_NFC_BARCODE

Added in[API level 19](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final int FLAG_READER_NFC_BARCODE
```

Flag for use with[enableReaderMode(android.app.Activity, android.nfc.NfcAdapter.ReaderCallback, int, android.os.Bundle)](https://developer.android.com/reference/android/nfc/NfcAdapter#enableReaderMode(android.app.Activity,%20android.nfc.NfcAdapter.ReaderCallback,%20int,%20android.os.Bundle)).

Setting this flag enables polling for NfcBarcode technology.

<br />

Constant Value: 16 (0x00000010)  

### FLAG_READER_NFC_F

Added in[API level 19](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final int FLAG_READER_NFC_F
```

Flag for use with[enableReaderMode(android.app.Activity, android.nfc.NfcAdapter.ReaderCallback, int, android.os.Bundle)](https://developer.android.com/reference/android/nfc/NfcAdapter#enableReaderMode(android.app.Activity,%20android.nfc.NfcAdapter.ReaderCallback,%20int,%20android.os.Bundle)).

Setting this flag enables polling for Nfc-F technology.

<br />

Constant Value: 4 (0x00000004)  

### FLAG_READER_NFC_V

Added in[API level 19](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final int FLAG_READER_NFC_V
```

Flag for use with[enableReaderMode(android.app.Activity, android.nfc.NfcAdapter.ReaderCallback, int, android.os.Bundle)](https://developer.android.com/reference/android/nfc/NfcAdapter#enableReaderMode(android.app.Activity,%20android.nfc.NfcAdapter.ReaderCallback,%20int,%20android.os.Bundle)).

Setting this flag enables polling for Nfc-V (ISO15693) technology.

<br />

Constant Value: 8 (0x00000008)  

### FLAG_READER_NO_PLATFORM_SOUNDS

Added in[API level 19](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final int FLAG_READER_NO_PLATFORM_SOUNDS
```

Flag for use with[enableReaderMode(android.app.Activity, android.nfc.NfcAdapter.ReaderCallback, int, android.os.Bundle)](https://developer.android.com/reference/android/nfc/NfcAdapter#enableReaderMode(android.app.Activity,%20android.nfc.NfcAdapter.ReaderCallback,%20int,%20android.os.Bundle)).

Setting this flag allows the caller to prevent the platform from playing sounds when it discovers a tag.

<br />

Constant Value: 256 (0x00000100)  

### FLAG_READER_SKIP_NDEF_CHECK

Added in[API level 19](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final int FLAG_READER_SKIP_NDEF_CHECK
```

Flag for use with[enableReaderMode(android.app.Activity, android.nfc.NfcAdapter.ReaderCallback, int, android.os.Bundle)](https://developer.android.com/reference/android/nfc/NfcAdapter#enableReaderMode(android.app.Activity,%20android.nfc.NfcAdapter.ReaderCallback,%20int,%20android.os.Bundle)).

Setting this flag allows the caller to prevent the platform from performing an NDEF check on the tags it finds.

<br />

Constant Value: 128 (0x00000080)  

### PREFERRED_PAYMENT_CHANGED

Added in[API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final int PREFERRED_PAYMENT_CHANGED
```

User selected another payment application as the preferred payment.

<br />

Constant Value: 2 (0x00000002)  

### PREFERRED_PAYMENT_LOADED

Added in[API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final int PREFERRED_PAYMENT_LOADED
```

Nfc is enabled and the preferred payment aids are registered.

<br />

Constant Value: 1 (0x00000001)  

### PREFERRED_PAYMENT_UPDATED

Added in[API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final int PREFERRED_PAYMENT_UPDATED
```

Current preferred payment has issued an update (registered/unregistered new aids or has been updated itself).

<br />

Constant Value: 3 (0x00000003)  

### STATE_OFF

Added in[API level 18](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final int STATE_OFF
```

<br />

<br />

Constant Value: 1 (0x00000001)  

### STATE_ON

Added in[API level 18](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final int STATE_ON
```

<br />

<br />

Constant Value: 3 (0x00000003)  

### STATE_TURNING_OFF

Added in[API level 18](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final int STATE_TURNING_OFF
```

<br />

<br />

Constant Value: 4 (0x00000004)  

### STATE_TURNING_ON

Added in[API level 18](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final int STATE_TURNING_ON
```

<br />

<br />

Constant Value: 2 (0x00000002)

## Public methods

### disable

Added in[API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public boolean disable ()
```

Disable NFC hardware.

No NFC features will work after this call, and the hardware will not perform or respond to any NFC communication.

This call is asynchronous. Listen for[ACTION_ADAPTER_STATE_CHANGED](https://developer.android.com/reference/android/nfc/NfcAdapter#ACTION_ADAPTER_STATE_CHANGED)broadcasts to find out when the operation is complete.

This API is only allowed to be called by system apps or apps which are Device Owner or Profile Owner.

If this returns true, then either NFC is already off, or a[ACTION_ADAPTER_STATE_CHANGED](https://developer.android.com/reference/android/nfc/NfcAdapter#ACTION_ADAPTER_STATE_CHANGED)broadcast will be sent to indicate a state transition. If this returns false, then there is some problem that prevents an attempt to turn NFC off.  
Requires[Manifest.permission.WRITE_SECURE_SETTINGS](https://developer.android.com/reference/android/Manifest.permission#WRITE_SECURE_SETTINGS)

<br />

|      Returns      ||
|-----------|--------|
| `boolean` | <br /> |

### disableForegroundDispatch

Added in[API level 10](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public void disableForegroundDispatch (Activity activity)
```

Disable foreground dispatch to the given activity.

After calling[enableForegroundDispatch(Activity, PendingIntent, IntentFilter, String)](https://developer.android.com/reference/android/nfc/NfcAdapter#enableForegroundDispatch(android.app.Activity,%20android.app.PendingIntent,%20android.content.IntentFilter[],%20java.lang.String[][])), an activity must call this method before its[Activity.onPause](https://developer.android.com/reference/android/app/Activity#onPause())callback completes.

This method must be called from the main thread.

Requires the[Manifest.permission.NFC](https://developer.android.com/reference/android/Manifest.permission#NFC)permission.

<br />

|                             Parameters                             ||
|------------|--------------------------------------------------------|
| `activity` | `Activity`: the Activity to disable dispatch to <br /> |

|                                                                          Throws                                                                           ||
|------------------------------------------------------------------------------------------------------------------|-----------------------------------------|
| [IllegalStateException](https://developer.android.com/reference/java/lang/IllegalStateException)                 | if the Activity has already been paused |
| [UnsupportedOperationException](https://developer.android.com/reference/java/lang/UnsupportedOperationException) | if FEATURE_NFC is unavailable.          |

### disableReaderMode

Added in[API level 19](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public void disableReaderMode (Activity activity)
```

Restore the NFC adapter to normal mode of operation: supporting peer-to-peer (Android Beam), card emulation, and polling for all supported tag technologies.

<br />

|                                     Parameters                                     ||
|------------|------------------------------------------------------------------------|
| `activity` | `Activity`: the Activity that currently has reader mode enabled <br /> |

|                                                                      Throws                                                                      ||
|------------------------------------------------------------------------------------------------------------------|--------------------------------|
| [UnsupportedOperationException](https://developer.android.com/reference/java/lang/UnsupportedOperationException) | if FEATURE_NFC is unavailable. |

### enable

Added in[API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public boolean enable ()
```

Enable NFC hardware.

This call is asynchronous. Listen for[ACTION_ADAPTER_STATE_CHANGED](https://developer.android.com/reference/android/nfc/NfcAdapter#ACTION_ADAPTER_STATE_CHANGED)broadcasts to find out when the operation is complete.

This API is only allowed to be called by system apps or apps which are Device Owner or Profile Owner.

If this returns true, then either NFC is already on, or a[ACTION_ADAPTER_STATE_CHANGED](https://developer.android.com/reference/android/nfc/NfcAdapter#ACTION_ADAPTER_STATE_CHANGED)broadcast will be sent to indicate a state transition. If this returns false, then there is some problem that prevents an attempt to turn NFC on (for example we are in airplane mode and NFC is not toggleable in airplane mode on this platform).  
Requires[Manifest.permission.WRITE_SECURE_SETTINGS](https://developer.android.com/reference/android/Manifest.permission#WRITE_SECURE_SETTINGS)

<br />

|      Returns      ||
|-----------|--------|
| `boolean` | <br /> |

### enableForegroundDispatch

Added in[API level 10](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public void enableForegroundDispatch (Activity activity, 
                PendingIntent intent, 
                IntentFilter[] filters, 
                String[][] techLists)
```

Enable foreground dispatch to the given Activity.

This will give priority to the foreground activity when dispatching a discovered[Tag](https://developer.android.com/reference/android/nfc/Tag)to an application.

If any IntentFilters are provided to this method they are used to match dispatch Intents for both the[NfcAdapter.ACTION_NDEF_DISCOVERED](https://developer.android.com/reference/android/nfc/NfcAdapter#ACTION_NDEF_DISCOVERED)and[NfcAdapter.ACTION_TAG_DISCOVERED](https://developer.android.com/reference/android/nfc/NfcAdapter#ACTION_TAG_DISCOVERED). Since[NfcAdapter.ACTION_TECH_DISCOVERED](https://developer.android.com/reference/android/nfc/NfcAdapter#ACTION_TECH_DISCOVERED)relies on meta data outside of the IntentFilter matching for that dispatch Intent is handled by passing in the tech lists separately. Each first level entry in the tech list represents an array of technologies that must all be present to match. If any of the first level sets match then the dispatch is routed through the given PendingIntent. In other words, the second level is ANDed together and the first level entries are ORed together.

If you pass`null`for both the`filters`and`techLists`parameters that acts a wild card and will cause the foreground activity to receive all tags via the[NfcAdapter.ACTION_TAG_DISCOVERED](https://developer.android.com/reference/android/nfc/NfcAdapter#ACTION_TAG_DISCOVERED)intent.

This method must be called from the main thread, and only when the activity is in the foreground (resumed). Also, activities must call[disableForegroundDispatch(Activity)](https://developer.android.com/reference/android/nfc/NfcAdapter#disableForegroundDispatch(android.app.Activity))before the completion of their[Activity.onPause](https://developer.android.com/reference/android/app/Activity#onPause())callback to disable foreground dispatch after it has been enabled.

Requires the[Manifest.permission.NFC](https://developer.android.com/reference/android/Manifest.permission#NFC)permission.

<br />

|                                                                                                          Parameters                                                                                                          ||
|-------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `activity`  | `Activity`: the Activity to dispatch to <br />                                                                                                                                                                  |
| `intent`    | `PendingIntent`: the PendingIntent to start for the dispatch <br />                                                                                                                                             |
| `filters`   | `IntentFilter`: the IntentFilters to override dispatching for, or null to always dispatch <br />                                                                                                                |
| `techLists` | `String`: the tech lists used to perform matching for dispatching of the[NfcAdapter.ACTION_TECH_DISCOVERED](https://developer.android.com/reference/android/nfc/NfcAdapter#ACTION_TECH_DISCOVERED)intent <br /> |

|                                                                                Throws                                                                                ||
|------------------------------------------------------------------------------------------------------------------|----------------------------------------------------|
| [IllegalStateException](https://developer.android.com/reference/java/lang/IllegalStateException)                 | if the Activity is not currently in the foreground |
| [UnsupportedOperationException](https://developer.android.com/reference/java/lang/UnsupportedOperationException) | if FEATURE_NFC is unavailable.                     |

### enableReaderMode

Added in[API level 19](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public void enableReaderMode (Activity activity, 
                NfcAdapter.ReaderCallback callback, 
                int flags, 
                Bundle extras)
```

Limit the NFC controller to reader mode while this Activity is in the foreground.

In this mode the NFC controller will only act as an NFC tag reader/writer, thus disabling any peer-to-peer (Android Beam) and card-emulation modes of the NFC adapter on this device.

Use[FLAG_READER_SKIP_NDEF_CHECK](https://developer.android.com/reference/android/nfc/NfcAdapter#FLAG_READER_SKIP_NDEF_CHECK)to prevent the platform from performing any NDEF checks in reader mode. Note that this will prevent the[Ndef](https://developer.android.com/reference/android/nfc/tech/Ndef)tag technology from being enumerated on the tag, and that NDEF-based tag dispatch will not be functional.

For interacting with tags that are emulated on another Android device using Android's host-based card-emulation, the recommended flags are[FLAG_READER_NFC_A](https://developer.android.com/reference/android/nfc/NfcAdapter#FLAG_READER_NFC_A)and[FLAG_READER_SKIP_NDEF_CHECK](https://developer.android.com/reference/android/nfc/NfcAdapter#FLAG_READER_SKIP_NDEF_CHECK).

<br />

|                                             Parameters                                             ||
|------------|----------------------------------------------------------------------------------------|
| `activity` | `Activity`: the Activity that requests the adapter to be in reader mode <br />         |
| `callback` | `NfcAdapter.ReaderCallback`: the callback to be called when a tag is discovered <br /> |
| `flags`    | `int`: Flags indicating poll technologies and other optional parameters <br />         |
| `extras`   | `Bundle`: Additional extras for configuring reader mode. <br />                        |

|                                                                      Throws                                                                      ||
|------------------------------------------------------------------------------------------------------------------|--------------------------------|
| [UnsupportedOperationException](https://developer.android.com/reference/java/lang/UnsupportedOperationException) | if FEATURE_NFC is unavailable. |

### getDefaultAdapter

Added in[API level 10](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static NfcAdapter getDefaultAdapter (Context context)
```

Helper to get the default NFC Adapter.

Most Android devices will only have one NFC Adapter (NFC Controller).

This helper is the equivalent of:  

```
 NfcManager manager = (NfcManager) context.getSystemService(Context.NFC_SERVICE);
 NfcAdapter adapter = manager.getDefaultAdapter();
```

<br />

<br />

|                           Parameters                           ||
|-----------|-----------------------------------------------------|
| `context` | `Context`: the calling application's context <br /> |

|                                                                    Returns                                                                     ||
|------------------------------------------------------------------------------|------------------------------------------------------------------|
| [NfcAdapter](https://developer.android.com/reference/android/nfc/NfcAdapter) | the default NFC adapter, or null if no NFC adapter exists <br /> |

### getNfcAntennaInfo

Added in[API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public NfcAntennaInfo getNfcAntennaInfo ()
```

Returns information regarding Nfc antennas on the device such as their relative positioning on the device.

<br />

|                                                                                Returns                                                                                 ||
|--------------------------------------------------------------------------------------|----------------------------------------------------------------------------------|
| [NfcAntennaInfo](https://developer.android.com/reference/android/nfc/NfcAntennaInfo) | Information on the nfc antenna(s) on the device. This value may be`null`. <br /> |

|                                                                                                                                                    Throws                                                                                                                                                     ||
|------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [UnsupportedOperationException](https://developer.android.com/reference/java/lang/UnsupportedOperationException) | if FEATURE_NFC, FEATURE_NFC_HOST_CARD_EMULATION, FEATURE_NFC_HOST_CARD_EMULATION_NFCF, FEATURE_NFC_OFF_HOST_CARD_EMULATION_UICC and FEATURE_NFC_OFF_HOST_CARD_EMULATION_ESE are unavailable |

### ignore

Added in[API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public boolean ignore (Tag tag, 
                int debounceMs, 
                NfcAdapter.OnTagRemovedListener tagRemovedListener, 
                Handler handler)
```

Signals that you are no longer interested in communicating with an NFC tag for as long as it remains in range. All future attempted communication to this tag will fail with[ERROR(/IOException)](https://developer.android.com/). The NFC controller will be put in a low-power polling mode, allowing the device to save power in cases where it's "attached" to a tag all the time (e.g. a tag in car dock). Additionally the debounceMs parameter allows you to specify for how long the tag needs to have gone out of range, before it will be dispatched again. Note: the NFC controller typically polls at a pretty slow interval (100 - 500 ms). This means that if the tag repeatedly goes in and out of range (for example, in case of a flaky connection), and the controller happens to poll every time the tag is out of range, it \*will\* re-dispatch the tag after debounceMs, despite the tag having been "in range" during the interval. Note 2: if a tag with another UID is detected after this API is called, its effect will be cancelled; if this tag shows up before the amount of time specified in debounceMs, it will be dispatched again. Note 3: some tags have a random UID, in which case this API won't work reliably.

<br />

|                                                                                                                                                           Parameters                                                                                                                                                           ||
|----------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `tag`                | `Tag`: the[Tag](https://developer.android.com/reference/android/nfc/Tag)to ignore. <br />                                                                                                                                                                                                                |
| `debounceMs`         | `int`: minimum amount of time the tag needs to be out of range before being dispatched again. <br />                                                                                                                                                                                                     |
| `tagRemovedListener` | `NfcAdapter.OnTagRemovedListener`: listener to be called when the tag is removed from the field. Note that this will only be called if the tag has been out of range for at least debounceMs, or if another tag came into range before debounceMs. May be null in case you don't want a callback. <br /> |
| `handler`            | `Handler`: the[Handler](https://developer.android.com/reference/android/os/Handler)that will be used for delivering the callback. if the handler is null, then the thread used for delivering the callback is unspecified. <br />                                                                        |

|                                                 Returns                                                 ||
|-----------|----------------------------------------------------------------------------------------------|
| `boolean` | false if the tag couldn't be found (or has already gone out of range), true otherwise <br /> |

### isEnabled

Added in[API level 9](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public boolean isEnabled ()
```

Return true if this NFC Adapter has any features enabled.

If this method returns false, the NFC hardware is guaranteed not to generate or respond to any NFC communication over its NFC radio.

Applications can use this to check if NFC is enabled. Applications can request Settings UI allowing the user to toggle NFC using:

<br />

```
startActivity(new Intent(Settings.ACTION_NFC_SETTINGS))
```

<br />

<br />

|                               Returns                               ||
|-----------|----------------------------------------------------------|
| `boolean` | true if this NFC Adapter has any features enabled <br /> |

**See also:**

- [Settings.ACTION_NFC_SETTINGS](https://developer.android.com/reference/android/provider/Settings#ACTION_NFC_SETTINGS)  

### isExitFramesSupported

Added in[version 36.1](https://developer.android.com/topic/libraries/support-library/revisions)  

```
public boolean isExitFramesSupported ()
```

Returns whether the device supports exit frames or not. Exit frames allow device firmware to handle the transition out of observe mode for certain auto-transacting[polling loop filters](https://develop/connectivity/nfc/hce#polling-loop-filters). Polling loop filters set by the default wallet role holder ([RoleManager.ROLE_WALLET](https://developer.android.com/reference/android/app/role/RoleManager#ROLE_WALLET)) will be prioritized for use with exit frames.

<br />

|                                   Returns                                   ||
|-----------|------------------------------------------------------------------|
| `boolean` | True if the device supports exit frames, false otherwise. <br /> |

### isObserveModeEnabled

Added in[API level 35](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public boolean isObserveModeEnabled ()
```

Returns whether Observe Mode is currently enabled or not.

<br />

|                               Returns                               ||
|-----------|----------------------------------------------------------|
| `boolean` | true if observe mode is enabled, false otherwise. <br /> |

### isObserveModeSupported

Added in[API level 35](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public boolean isObserveModeSupported ()
```

Returns whether the device supports observe mode or not. When observe mode is enabled, the NFC hardware will listen to NFC readers, but not respond to them. While enabled, observed polling frames will be sent to the APDU service (see[setObserveModeEnabled(boolean)](https://developer.android.com/reference/android/nfc/NfcAdapter#setObserveModeEnabled(boolean)). When observe mode is disabled (or if it's not supported), the NFC hardware will automatically respond to the reader and proceed with the transaction.

<br />

|                              Returns                              ||
|-----------|--------------------------------------------------------|
| `boolean` | true if the mode is supported, false otherwise. <br /> |

### isPowerSavingModeEnabled

Added in[version 36.1](https://developer.android.com/topic/libraries/support-library/revisions)  

```
public boolean isPowerSavingModeEnabled ()
```

Returns whether power-saving mode is currently enabled or not.

<br />

|                                 Returns                                 ||
|-----------|--------------------------------------------------------------|
| `boolean` | True if power saving mode is enabled, false otherwise <br /> |

### isPowerSavingModeSupported

Added in[version 36.1](https://developer.android.com/topic/libraries/support-library/revisions)  

```
public boolean isPowerSavingModeSupported ()
```

Returns whether the device supports power-saving mode or not.

<br />

|                                     Returns                                      ||
|-----------|-----------------------------------------------------------------------|
| `boolean` | True if the device supports power-saving mode, false otherwise <br /> |

### isReaderOptionEnabled

Added in[API level 35](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public boolean isReaderOptionEnabled ()
```

Checks NFC Reader option feature is enabled.

<br />

|                                 Returns                                 ||
|-----------|--------------------------------------------------------------|
| `boolean` | True if NFC Reader option is enabled, false otherwise <br /> |

|                                                                                                                                              Throws                                                                                                                                               ||
|------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [UnsupportedOperationException](https://developer.android.com/reference/java/lang/UnsupportedOperationException) | if FEATURE_NFC is unavailable.                                                                                                                                                  |
| [UnsupportedOperationException](https://developer.android.com/reference/java/lang/UnsupportedOperationException) | if device doesn't support NFC Reader option functionality.[isReaderOptionSupported()](https://developer.android.com/reference/android/nfc/NfcAdapter#isReaderOptionSupported()) |

### isReaderOptionSupported

Added in[API level 35](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public boolean isReaderOptionSupported ()
```

Checks if the device supports NFC Reader option functionality.

<br />

|                                   Returns                                    ||
|-----------|-------------------------------------------------------------------|
| `boolean` | True if device supports NFC Reader option, false otherwise <br /> |

|                                                                      Throws                                                                      ||
|------------------------------------------------------------------------------------------------------------------|--------------------------------|
| [UnsupportedOperationException](https://developer.android.com/reference/java/lang/UnsupportedOperationException) | if FEATURE_NFC is unavailable. |

### isSecureNfcEnabled

Added in[API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public boolean isSecureNfcEnabled ()
```

Checks Secure NFC feature is enabled.

<br />

|                             Returns                              ||
|-----------|-------------------------------------------------------|
| `boolean` | True if Secure NFC is enabled, false otherwise <br /> |

|                                                                                                                                                    Throws                                                                                                                                                     ||
|------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [UnsupportedOperationException](https://developer.android.com/reference/java/lang/UnsupportedOperationException) | if FEATURE_NFC, FEATURE_NFC_HOST_CARD_EMULATION, FEATURE_NFC_HOST_CARD_EMULATION_NFCF, FEATURE_NFC_OFF_HOST_CARD_EMULATION_UICC and FEATURE_NFC_OFF_HOST_CARD_EMULATION_ESE are unavailable |
| [UnsupportedOperationException](https://developer.android.com/reference/java/lang/UnsupportedOperationException) | if device doesn't support Secure NFC functionality.[isSecureNfcSupported()](https://developer.android.com/reference/android/nfc/NfcAdapter#isSecureNfcSupported())                          |

### isSecureNfcSupported

Added in[API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public boolean isSecureNfcSupported ()
```

Checks if the device supports Secure NFC functionality.

<br />

|                                Returns                                ||
|-----------|------------------------------------------------------------|
| `boolean` | True if device supports Secure NFC, false otherwise <br /> |

|                                                                                                                                                    Throws                                                                                                                                                     ||
|------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [UnsupportedOperationException](https://developer.android.com/reference/java/lang/UnsupportedOperationException) | if FEATURE_NFC, FEATURE_NFC_HOST_CARD_EMULATION, FEATURE_NFC_HOST_CARD_EMULATION_NFCF, FEATURE_NFC_OFF_HOST_CARD_EMULATION_UICC and FEATURE_NFC_OFF_HOST_CARD_EMULATION_ESE are unavailable |

### isTagIntentAllowed

Added in[API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public boolean isTagIntentAllowed ()
```

Checks whether the user has disabled the calling app from receiving NFC tag intents.

This method checks whether the caller package name is either not present in the user disabled list or is explicitly allowed by the user.

<br />

|                                                                                                                                 Returns                                                                                                                                 ||
|-----------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `boolean` | `true`if an app is either not present in the list or is added to the list with the flag set to`true`. Otherwise, it returns`false`. It also returns`true`if[ERROR(/isTagIntentAppPreferenceSupported)](https://developer.android.com/)returns`false`. <br /> |

|                                                                      Throws                                                                      ||
|------------------------------------------------------------------------------------------------------------------|--------------------------------|
| [UnsupportedOperationException](https://developer.android.com/reference/java/lang/UnsupportedOperationException) | if FEATURE_NFC is unavailable. |

### isTagIntentAppPreferenceSupported

Added in[API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public boolean isTagIntentAppPreferenceSupported ()
```

Checks if the device supports Tag Intent App Preference functionality. When supported,[ACTION_NDEF_DISCOVERED](https://developer.android.com/reference/android/nfc/NfcAdapter#ACTION_NDEF_DISCOVERED),[ACTION_TECH_DISCOVERED](https://developer.android.com/reference/android/nfc/NfcAdapter#ACTION_TECH_DISCOVERED)or[ACTION_TAG_DISCOVERED](https://developer.android.com/reference/android/nfc/NfcAdapter#ACTION_TAG_DISCOVERED)will not be dispatched to an Activity if[ERROR(/isTagIntentAllowed)](https://developer.android.com/)returns`false`.

<br />

|                                          Returns                                           ||
|-----------|---------------------------------------------------------------------------------|
| `boolean` | `true`if the device supports Tag application preference,`false`otherwise <br /> |

|                                                                     Throws                                                                      ||
|------------------------------------------------------------------------------------------------------------------|-------------------------------|
| [UnsupportedOperationException](https://developer.android.com/reference/java/lang/UnsupportedOperationException) | if FEATURE_NFC is unavailable |

### resetDiscoveryTechnology

Added in[API level 35](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public void resetDiscoveryTechnology (Activity activity)
```

Restore the poll/listen technologies of NFC controller to its default state, which were changed by[setDiscoveryTechnology(android.app.Activity, int, int)](https://developer.android.com/reference/android/nfc/NfcAdapter#setDiscoveryTechnology(android.app.Activity,%20int,%20int))

<br />

|                                                   Parameters                                                   ||
|------------|----------------------------------------------------------------------------------------------------|
| `activity` | `Activity`: The Activity that requested to change technologies. This value cannot be`null`. <br /> |

### setDiscoveryTechnology

Added in[API level 35](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public void setDiscoveryTechnology (Activity activity, 
                int pollTechnology, 
                int listenTechnology)
```

Set the NFC controller to enable specific poll/listen technologies, as specified in parameters, while this Activity is in the foreground. Use[FLAG_READER_KEEP](https://developer.android.com/reference/android/nfc/NfcAdapter#FLAG_READER_KEEP)to keep current polling technology. Use[FLAG_LISTEN_KEEP](https://developer.android.com/reference/android/nfc/NfcAdapter#FLAG_LISTEN_KEEP)to keep current listenig technology. (if the _KEEP flag is specified the other technology flags shouldn't be set and are quietly ignored otherwise). Use[FLAG_READER_DISABLE](https://developer.android.com/reference/android/nfc/NfcAdapter#FLAG_READER_DISABLE)to disable polling. Use[FLAG_LISTEN_DISABLE](https://developer.android.com/reference/android/nfc/NfcAdapter#FLAG_LISTEN_DISABLE)to disable listening. Also refer to[resetDiscoveryTechnology(android.app.Activity)](https://developer.android.com/reference/android/nfc/NfcAdapter#resetDiscoveryTechnology(android.app.Activity))to restore these changes.
The pollTechnology, listenTechnology parameters can be one or several of below list.  

```
                    Poll                    Listen
  Passive A         0x01   (NFC_A)           0x01  (NFC_PASSIVE_A)
  Passive B         0x02   (NFC_B)           0x02  (NFC_PASSIVE_B)
  Passive F         0x04   (NFC_F)           0x04  (NFC_PASSIVE_F)
  ISO 15693         0x08   (NFC_V)             -
  Kovio             0x10   (NFC_BARCODE)       -
 
```

Example usage in an Activity that requires to disable poll, keep current listen technologies:  

```
 protected void onResume() {
     mNfcAdapter = NfcAdapter.getDefaultAdapter(getApplicationContext());
     mNfcAdapter.setDiscoveryTechnology(this,
         NfcAdapter.FLAG_READER_DISABLE, NfcAdapter.FLAG_LISTEN_KEEP);
 }
```

<br />

<br />

<br />

|                                                                                                                                                                                                                                                                                                                                                                                                                                                      Parameters                                                                                                                                                                                                                                                                                                                                                                                                                                                      ||
|--------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `activity`         | `Activity`: The Activity that requests NFC controller to enable specific technologies. This can be null for privileged apps. <br />                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| `pollTechnology`   | `int`: Flags indicating poll technologies. Value is either`0`or a combination of android.nfc.NfcAdapter.FLAG_SET_DEFAULT_TECH,[FLAG_READER_KEEP](https://developer.android.com/reference/android/nfc/NfcAdapter#FLAG_READER_KEEP),[FLAG_READER_DISABLE](https://developer.android.com/reference/android/nfc/NfcAdapter#FLAG_READER_DISABLE),[FLAG_READER_NFC_A](https://developer.android.com/reference/android/nfc/NfcAdapter#FLAG_READER_NFC_A),[FLAG_READER_NFC_B](https://developer.android.com/reference/android/nfc/NfcAdapter#FLAG_READER_NFC_B),[FLAG_READER_NFC_F](https://developer.android.com/reference/android/nfc/NfcAdapter#FLAG_READER_NFC_F),[FLAG_READER_NFC_V](https://developer.android.com/reference/android/nfc/NfcAdapter#FLAG_READER_NFC_V), and[FLAG_READER_NFC_BARCODE](https://developer.android.com/reference/android/nfc/NfcAdapter#FLAG_READER_NFC_BARCODE) <br /> |
| `listenTechnology` | `int`: Flags indicating listen technologies. Value is either`0`or a combination of android.nfc.NfcAdapter.FLAG_SET_DEFAULT_TECH,[FLAG_LISTEN_KEEP](https://developer.android.com/reference/android/nfc/NfcAdapter#FLAG_LISTEN_KEEP),[FLAG_LISTEN_DISABLE](https://developer.android.com/reference/android/nfc/NfcAdapter#FLAG_LISTEN_DISABLE),[FLAG_LISTEN_NFC_PASSIVE_A](https://developer.android.com/reference/android/nfc/NfcAdapter#FLAG_LISTEN_NFC_PASSIVE_A),[FLAG_LISTEN_NFC_PASSIVE_B](https://developer.android.com/reference/android/nfc/NfcAdapter#FLAG_LISTEN_NFC_PASSIVE_B), and[FLAG_LISTEN_NFC_PASSIVE_F](https://developer.android.com/reference/android/nfc/NfcAdapter#FLAG_LISTEN_NFC_PASSIVE_F) <br />                                                                                                                                                                       |

|                                                                                                                                                                                                                               Throws                                                                                                                                                                                                                               ||
|------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [UnsupportedOperationException](https://developer.android.com/reference/java/lang/UnsupportedOperationException) | if FEATURE_NFC, FEATURE_NFC_HOST_CARD_EMULATION, FEATURE_NFC_HOST_CARD_EMULATION_NFCF are unavailable. NOTE: This API overrides all technology flags regardless of the current device state, it is incompatible with enableReaderMode() API and the others that either update or assume any techlology flag set by the OS. Please use with care. |

### setObserveModeEnabled

Added in[API level 35](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public boolean setObserveModeEnabled (boolean enabled)
```

Controls whether the NFC adapter will allow transactions to proceed or be in observe mode and simply observe and notify the APDU service of polling loop frames. See[isObserveModeSupported()](https://developer.android.com/reference/android/nfc/NfcAdapter#isObserveModeSupported())for a description of observe mode. Only the package of the currently preferred service (the service set as preferred by the current foreground application via[CardEmulation.setPreferredService(Activity, android.content.ComponentName)](https://developer.android.com/reference/android/nfc/cardemulation/CardEmulation#setPreferredService(android.app.Activity,%20android.content.ComponentName))or the current Default Wallet Role Holder[RoleManager.ROLE_WALLET](https://developer.android.com/reference/android/app/role/RoleManager#ROLE_WALLET)), otherwise a call to this method will fail and return false.

<br />

|                                                                                Parameters                                                                                ||
|-----------|---------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `enabled` | `boolean`: false disables observe mode to allow the transaction to proceed while true enables observe mode and does not allow transactions to proceed. <br /> |

|                         Returns                          ||
|-----------|-----------------------------------------------|
| `boolean` | boolean indicating success or failure. <br /> |

### setPowerSavingMode

Added in[version 36.1](https://developer.android.com/topic/libraries/support-library/revisions)  

```
public void setPowerSavingMode (boolean enabled)
```

Sets whether or not the NFC chip should be in power-saving mode next time it is disabled with[NfcAdapter.disable()](https://developer.android.com/reference/android/nfc/NfcAdapter#disable()). If the chip is already disabled, power-saving mode will take effect immediately.

This mode puts the NFC chip in a very low power mode, but not fully turned off. This mode limits communication between the NFC chip and the host processor to conserve power, although the exact implementation may depend on the device's underlying hardware. Other NFC APIs are disabled while this mode is active.  
Requires[ERROR(/android.Manifest.permission#NFC_SET_CONTROLLER_ALWAYS_ON)](https://developer.android.com/)

<br />

|         Parameters          ||
|-----------|------------------|
| `enabled` | `boolean` <br /> |

|                                                                                                        Throws                                                                                                        ||
|------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------|
| [UnsupportedOperationException](https://developer.android.com/reference/java/lang/UnsupportedOperationException) | If the device does not support power-saving mode.                                                  |
| [IllegalStateException](https://developer.android.com/reference/java/lang/IllegalStateException)                 | If a transient failure related to current device state prevented power-saving mode from being set. |