NfcAdapter Class
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Represents the local NFC adapter.
[Android.Runtime.Register("android/nfc/NfcAdapter", DoNotGenerateAcw=true)]
public sealed class NfcAdapter : Java.Lang.Object
[<Android.Runtime.Register("android/nfc/NfcAdapter", DoNotGenerateAcw=true)>]
type NfcAdapter = class
inherit Object
- Inheritance
- Attributes
Remarks
Represents the local NFC adapter.
Use the helper #getDefaultAdapter(Context)
to get the default NFC adapter for this Android device.
<div class="special reference"> <h3>Developer Guides</h3>
For more information about using NFC, read the Near Field Communication developer guide.
To perform basic file sharing between devices, read Sharing Files with NFC. </div>
Java documentation for android.nfc.NfcAdapter
.
Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.
Fields
ActionAdapterStateChanged |
Broadcast Action: The state of the local NFC adapter has been changed. |
ActionNdefDiscovered |
Intent to start an activity when a tag with NDEF payload is discovered. |
ActionPreferredPaymentChanged |
Broadcast Action: Intent to notify if the preferred payment service changed. |
ActionTagDiscovered |
Intent to start an activity when a tag is discovered. |
ActionTechDiscovered |
Intent to start an activity when a tag is discovered and activities are registered for the specific technologies on the tag. |
ActionTransactionDetected |
Broadcast Action: Intent to notify an application that a transaction event has occurred on the Secure Element. |
ExtraAdapterState |
Used as an int extra field in |
ExtraAid |
Mandatory byte[] extra field in |
ExtraData |
Optional byte[] extra field in |
ExtraId |
Optional extra containing a byte array containing the ID of the discovered tag for
the |
ExtraNdefMessages |
Extra containing an array of |
ExtraPreferredPaymentChangedReason |
Mandatory String extra field in |
ExtraReaderPresenceCheckDelay |
Int Extra for use with |
ExtraSecureElementName |
Mandatory String extra field in |
ExtraTag |
Mandatory extra containing the |
FlagReaderNfcA |
Obsolete.
Flag for use with |
FlagReaderNfcB |
Obsolete.
Flag for use with |
FlagReaderNfcBarcode |
Obsolete.
Flag for use with |
FlagReaderNfcF |
Obsolete.
Flag for use with |
FlagReaderNfcV |
Obsolete.
Flag for use with |
FlagReaderNoPlatformSounds |
Obsolete.
Flag for use with |
FlagReaderSkipNdefCheck |
Obsolete.
Flag for use with |
PreferredPaymentChanged |
Obsolete.
User selected another payment application as the preferred payment. |
PreferredPaymentLoaded |
Obsolete.
Nfc is enabled and the preferred payment aids are registered. |
PreferredPaymentUpdated |
Obsolete.
Current preferred payment has issued an update (registered/unregistered new aids or has been updated itself). |
StateOff | |
StateOn | |
StateTurningOff | |
StateTurningOn |
Properties
Class |
Returns the runtime class of this |
DefaultAdapter |
Obsolete.
Legacy NfcAdapter getter, always use |
Handle |
The handle to the underlying Android instance. (Inherited from Object) |
IsEnabled |
Return true if this NFC Adapter has any features enabled. |
IsNdefPushEnabled |
Return true if the NDEF Push (Android Beam) feature is enabled. |
IsSecureNfcEnabled |
Checks Secure NFC feature is enabled. |
IsSecureNfcSupported |
Checks if the device supports Secure NFC functionality. |
JniIdentityHashCode | (Inherited from Object) |
JniPeerMembers | |
NfcAntennaInfo |
Returns information regarding Nfc antennas on the device such as their relative positioning on the device. |
PeerReference | (Inherited from Object) |
ThresholdClass |
This API supports the Mono for Android infrastructure and is not intended to be used directly from your code. (Inherited from Object) |
ThresholdType |
This API supports the Mono for Android infrastructure and is not intended to be used directly from your code. (Inherited from Object) |
Methods
Clone() |
Creates and returns a copy of this object. (Inherited from Object) |
DisableForegroundDispatch(Activity) |
Disable foreground dispatch to the given activity. |
DisableForegroundNdefPush(Activity) |
Obsolete.
Disable NDEF message push over P2P. |
DisableReaderMode(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. |
Dispose() | (Inherited from Object) |
Dispose(Boolean) | (Inherited from Object) |
EnableForegroundDispatch(Activity, PendingIntent, IntentFilter[], String[][]) |
Enable foreground dispatch to the given Activity. |
EnableForegroundNdefPush(Activity, NdefMessage) |
Obsolete.
Enable NDEF message push over NFC while this Activity is in the foreground. |
EnableReaderMode(Activity, NfcAdapter+IReaderCallback, NfcReaderFlags, Bundle) |
Limit the NFC controller to reader mode while this Activity is in the foreground. |
Equals(Object) |
Indicates whether some other object is "equal to" this one. (Inherited from Object) |
GetDefaultAdapter(Context) |
Helper to get the default NFC Adapter. |
GetHashCode() |
Returns a hash code value for the object. (Inherited from Object) |
Ignore(Tag, Int32, NfcAdapter+IOnTagRemovedListener, Handler) |
Signals that you are no longer interested in communicating with an NFC tag for as long as it remains in range. |
InvokeBeam(Activity) |
Manually invoke Android Beam to share data. |
JavaFinalize() |
Called by the garbage collector on an object when garbage collection determines that there are no more references to the object. (Inherited from Object) |
Notify() |
Wakes up a single thread that is waiting on this object's monitor. (Inherited from Object) |
NotifyAll() |
Wakes up all threads that are waiting on this object's monitor. (Inherited from Object) |
SetBeamPushUris(Uri[], Activity) |
Set one or more |
SetBeamPushUrisCallback(NfcAdapter+ICreateBeamUrisCallback, Activity) |
Set a callback that will dynamically generate one or more |
SetHandle(IntPtr, JniHandleOwnership) |
Sets the Handle property. (Inherited from Object) |
SetNdefPushMessage(NdefMessage, Activity, Activity[]) | |
SetNdefPushMessageCallback(NfcAdapter+ICreateNdefMessageCallback, Activity, Activity[]) | |
SetOnNdefPushCompleteCallback(NfcAdapter+IOnNdefPushCompleteCallback, Activity, Activity[]) |
Set a callback on successful Android Beam (TM). |
ToArray<T>() | (Inherited from Object) |
ToString() |
Returns a string representation of the object. (Inherited from Object) |
UnregisterFromRuntime() | (Inherited from Object) |
Wait() |
Causes the current thread to wait until it is awakened, typically by being <em>notified</em> or <em>interrupted</em>. (Inherited from Object) |
Wait(Int64, Int32) |
Causes the current thread to wait until it is awakened, typically by being <em>notified</em> or <em>interrupted</em>, or until a certain amount of real time has elapsed. (Inherited from Object) |
Wait(Int64) |
Causes the current thread to wait until it is awakened, typically by being <em>notified</em> or <em>interrupted</em>, or until a certain amount of real time has elapsed. (Inherited from Object) |
Explicit Interface Implementations
IJavaPeerable.Disposed() | (Inherited from Object) |
IJavaPeerable.DisposeUnlessReferenced() | (Inherited from Object) |
IJavaPeerable.Finalized() | (Inherited from Object) |
IJavaPeerable.JniManagedPeerState | (Inherited from Object) |
IJavaPeerable.SetJniIdentityHashCode(Int32) | (Inherited from Object) |
IJavaPeerable.SetJniManagedPeerState(JniManagedPeerStates) | (Inherited from Object) |
IJavaPeerable.SetPeerReference(JniObjectReference) | (Inherited from Object) |
Extension Methods
JavaCast<TResult>(IJavaObject) |
Performs an Android runtime-checked type conversion. |
JavaCast<TResult>(IJavaObject) | |
GetJniTypeName(IJavaPeerable) |