Share via


HostNfcFService.ProcessNfcFPacket(Byte[], Bundle) Method

Definition

This method will be called when a NFC-F packet has been received from a remote device.

[Android.Runtime.Register("processNfcFPacket", "([BLandroid/os/Bundle;)[B", "GetProcessNfcFPacket_arrayBLandroid_os_Bundle_Handler", ApiSince=24)]
public abstract byte[]? ProcessNfcFPacket (byte[]? commandPacket, Android.OS.Bundle? extras);
[<Android.Runtime.Register("processNfcFPacket", "([BLandroid/os/Bundle;)[B", "GetProcessNfcFPacket_arrayBLandroid_os_Bundle_Handler", ApiSince=24)>]
abstract member ProcessNfcFPacket : byte[] * Android.OS.Bundle -> byte[]

Parameters

commandPacket
Byte[]

The NFC-F packet that was received from the remote device

extras
Bundle

A bundle containing extra data. May be null.

Returns

Byte[]

a byte-array containing the response packet, or null if no response packet can be sent at this point.

Attributes

Remarks

This method will be called when a NFC-F packet has been received from a remote device. A response packet can be provided directly by returning a byte-array in this method. Note that in general response packets must be sent as quickly as possible, given the fact that the user is likely holding their device over an NFC reader when this method is called.

<p class="note">This method is running on the main thread of your application. If you cannot return a response packet immediately, return null and use the #sendResponsePacket(byte[]) method later.

Java documentation for android.nfc.cardemulation.HostNfcFService.processNfcFPacket(byte[], android.os.Bundle).

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.

Applies to