title: Android NFC tag ID identify different nfc card type
body: <p>I want to use NFC reading in my app, where I read the ID of an NFC card.
  I have 2 different NFC cards.
  When I read them with my USB NFC reader in my computer, I get a 9 digit number for both cards, which is cool. I can identify the cards based on that number.</p>
  <p>Tthe problem occurs, when I want to read them in my app, like this:</p>
  <pre class="lang-java prettyprint-override"><code>                            new NfcAdapter.ReaderCallback() {
                                  @Override
                                  public void onTagDiscovered( final Tag tag ) {
                                      runOnUiThread(new Runnable() {
  
                                          @Override
                                          public void run() {
                                              System.out.println(tag.toString());
  
                                              // I get the ID here to identify the card
                                              String id = Long.toString(Utils.toDec(tag.getId())).trim();
                                          }
                                      });
  
                                  }
                              },
                              1 | NfcAdapter.FLAG_READER_SKIP_NDEF_CHECK,
                              options);
  </code></pre>
  <p>When I log the <code>toString()</code> method of the discovered TAG, I get this for the first card:</p>
  <pre><code>Tech [android.nfc.tech.NfcA, android.nfc.tech.MifareClassic]
  </code></pre>
  <p>And when I read the ID below <code>String id = Long.toString(Utils.toDec(tag.getId())).trim();</code> I get the same 9 digit number like in my computer, that's great, it's a unique id for the card.</p>
  <p>The second card's <code>toString()</code>:</p>
  <pre><code>Tech [android.nfc.tech.IsoDep, android.nfc.tech.NfcA]
  </code></pre>
  <p>And when I read the tag ID, I get a 17 digit number instead of the 9 digit...
  I tried to log everything in the discovered TAG, but I can't find the 9 digit number I can read from that card in my computer via USB reader. So I can't identify this NFC card.</p>
  <p>How can I solve this? I want to identify the cards via both USB reader and my app, so the 2 numbers has to be the same, like with the first card...</p>
  <p>Thanks!  :)</p>