nfc.inDataExchange messing with response apdu?

MisterFrench:
A little bit of update, guy on stackoverflow gave me some pointers although I haven't solved my problem yet. Here's how I send the response APDU:

    byte[] hashBuffer = {

(byte)0xe6, (byte)0x8d, (byte)0x3f, (byte)0x57,
                (byte)0x40, (byte)0x09, (byte)0xcb, (byte)0xbe,
                (byte)0x01, (byte)0x11, (byte)0x50, (byte)0x26,
                (byte)0x36, (byte)0x34, (byte)0xc5, (byte)0xc0
        };
        byte[] SW1 = {(byte)0x90};
        byte[] SW2 = {(byte)0x00};
        byte[] responseApdu = new byte[18];
        System.arraycopy(hashBuffer, 0, responseApdu, 0, 16);
        System.arraycopy(SW1, 0, responseApdu, 16, 1);
        System.arraycopy(SW2, 0, responseApdu, 17, 1);

return responseApdu;




(I know I could make this way shorter up there but I like to separate my code). 

(...)

Why do you use the SW1 and SW2 bytes? Is it mandatory?

My HCE Service is being well selected on Android but on Arduino side I always get false in the nfc.inDataExchange(...)

My Arduino code:

void loop()
{
  bool success;
  
  uint8_t responseLength;
  
  
  Serial.println("Waiting for an ISO14443A card");
  
  success = nfc.inListPassiveTarget();

  if(success) {
   
     Serial.println("Found something!");
                  
    uint8_t selectApdu[] = { 0x00, /* CLA */
                              0xA4, /* INS */
                              0x04, /* P1  */
                              0x00, /* P2  */
                              0x07, /* Length of AID  */
                              0xF0, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, /* AID */
                              0x00  /* Le  */ };
                              
    uint8_t response[32];  
     
    success = nfc.inDataExchange(selectApdu, sizeof(selectApdu), response, &responseLength);
    
    if(success) {
      
     Serial.print("responseLength: "); Serial.println(responseLength);
       
      nfc.PrintHexChar(response, responseLength);
      
      uint8_t i = 0;
      for( ; i < 5; i++) {
        uint8_t apdu[] = { 0x52, 0x52, 0x52, 0x52 };
        uint8_t back[32];
        uint8_t length; 
        
        nfc.inDataExchange(apdu, sizeof(apdu), back, &length);
        
        Serial.print("responseLength: "); Serial.println(length);
         
        nfc.PrintHexChar(back, length);
      }
    }
    else {
     
      Serial.println("Failed sending SELECT AID"); 
    }
  }
  else {
   
    Serial.println("Didn't find anything!");
  }

  
  delay(1000);
}

Should I set the responseLength before call inDataExchange(...)?

EDIT: The problem above was that I wasn't setting the value of responseLength. This must be the size of the responseBuffer. Sry, I forget to share the solution earlier.
For those who came after, you have now a working example in the library repository.