The host sends the following command to applet to select EF file
00 A4 02 00 02 40 01
The purpose is to select EF file with ID 40 01<
Depending on the card (or emulator), the APDU buffer may only contain the APDU header fields (CLA, INS, P1, P2, Lc). Even if some cards automatically fill the data part of the command APDU into the APDU buffer, you can't rely on that behavior.
Instead, you have to explicitly instruct the card (or emulator) to retrieve the data part by calling the setIncomingAndReceive()
method on the APDU object. But note that this method must only be called for case 3 and case 4 APDUs (i.e. APDU commands that contain a command data part). If there is no command data field, you should not call this method (case 1 and case 2 APDUs).
To get data in APDU buffer you need to call apdu.setIncomingAndReceive()
and as in EMV specification AID for an applet is 5-16 bytes can't use less than 5 bytes.