HostApduService.ProcessCommandApdu(Byte[], Bundle) Method

Definition

This method will be called when a command APDU has been received from a remote device.

[Android.Runtime.Register("processCommandApdu", "([BLandroid/os/Bundle;)[B", "GetProcessCommandApdu_arrayBLandroid_os_Bundle_Handler")]
public abstract byte[]? ProcessCommandApdu (byte[]? commandApdu, Android.OS.Bundle? extras);
[<Android.Runtime.Register("processCommandApdu", "([BLandroid/os/Bundle;)[B", "GetProcessCommandApdu_arrayBLandroid_os_Bundle_Handler")>]
abstract member ProcessCommandApdu : byte[] * Android.OS.Bundle -> byte[]

Parameters

commandApdu
Byte[]

The APDU 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 APDU, or null if no response APDU can be sent at this point.

Attributes

Remarks

This method will be called when a command APDU has been received from a remote device. A response APDU can be provided directly by returning a byte-array in this method. Note that in general response APDUs 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">If there are multiple services that have registered for the same AIDs in their meta-data entry, you will only get called if the user has explicitly selected your service, either as a default or just for the next tap.

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

Java documentation for android.nfc.cardemulation.HostApduService.processCommandApdu(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