The AID of my app is F239856324897348
and I have constructed a SelectAID APDU for it. Now how do I actually send it to the receiving Android device which is using host card emulation.
I have a created my HCE service to respond with a response APDU as in this thread: How to define an APDU for STORE DATA for Host Card Emulation?
public static byte[] SelectAID = new byte[]{
(byte) 0xF2, (byte) 0x39, (byte) 0x85, (byte) 0x63,
(byte) 0x24, (byte) 0x89, (byte) 0x73, (byte) 0x48};
private void commandAPDU(byte[] apdu){
//where do I go from here...
}
commandAPDU(SelectAID);
The format of APDUs is defined in ISO/IEC 7816-4. A typical SELECT (by AID) command looks like this:
You could create it like this:
You could then send such APDU commands to a tag/HCE device discovered through the reader-mode API: